Skip to content

Commit 3f68ba0

Browse files
miniplidavem330
authored andcommitted
Bluetooth: HCI - Fix info leak via getsockname()
The HCI code fails to initialize the hci_channel member of struct sockaddr_hci and that for leaks two bytes kernel stack via the getsockname() syscall. Initialize hci_channel with 0 to avoid the info leak. Signed-off-by: Mathias Krause <minipli@googlemail.com> Cc: Marcel Holtmann <marcel@holtmann.org> Cc: Gustavo Padovan <gustavo@padovan.org> Cc: Johan Hedberg <johan.hedberg@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent e15ca9a commit 3f68ba0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: net/bluetooth/hci_sock.c

+1
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,7 @@ static int hci_sock_getname(struct socket *sock, struct sockaddr *addr,
694694
*addr_len = sizeof(*haddr);
695695
haddr->hci_family = AF_BLUETOOTH;
696696
haddr->hci_dev = hdev->id;
697+
haddr->hci_channel= 0;
697698

698699
release_sock(sk);
699700
return 0;

0 commit comments

Comments
 (0)