Skip to content

Commit 8d03e97

Browse files
Filip PalianGustavo F. Padovan
authored andcommitted
Bluetooth: l2cap and rfcomm: fix 1 byte infoleak to userspace.
Structures "l2cap_conninfo" and "rfcomm_conninfo" have one padding byte each. This byte in "cinfo" is copied to userspace uninitialized. Signed-off-by: Filip Palian <filip.palian@pjwstk.edu.pl> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
1 parent 51892db commit 8d03e97

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

‎net/bluetooth/l2cap_sock.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ static int l2cap_sock_getsockopt_old(struct socket *sock, int optname, char __us
413413
break;
414414
}
415415

416+
memset(&cinfo, 0, sizeof(cinfo));
416417
cinfo.hci_handle = chan->conn->hcon->handle;
417418
memcpy(cinfo.dev_class, chan->conn->hcon->dev_class, 3);
418419

‎net/bluetooth/rfcomm/sock.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,7 @@ static int rfcomm_sock_getsockopt_old(struct socket *sock, int optname, char __u
788788

789789
l2cap_sk = rfcomm_pi(sk)->dlc->session->sock->sk;
790790

791+
memset(&cinfo, 0, sizeof(cinfo));
791792
cinfo.hci_handle = conn->hcon->handle;
792793
memcpy(cinfo.dev_class, conn->hcon->dev_class, 3);
793794

0 commit comments

Comments
 (0)