OSDN Git Service

[Bluetooth] Fix L2CAP and HCI setsockopt() information leaks (CVE-2007-1353)
authorWilly Tarreau <w@1wt.eu>
Sat, 14 Apr 2007 16:23:12 +0000 (18:23 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 18 Apr 2007 09:08:36 +0000 (11:08 +0200)
commit7d83d871b1fa17d8c23c8a03ae19ee772f3fe8dd
tree8f812e203e09076740f0645c8ff172a0c15c3db5
parent4f3130ac38618d699726cf2ea49347c982c2b2e7
[Bluetooth] Fix L2CAP and HCI setsockopt() information leaks (CVE-2007-1353)

Problem reported by Ilja van Sprundel. Assigned CVE-2007-1353.
Fix below from Marcel Holtmann, backported to 2.4.

The L2CAP and HCI setsockopt() implementations have a small information
leak that makes it possible to leak kernel stack memory to userspace.

If the optlen parameter is 0, no data will be copied by copy_from_user(),
but the uninitialized stack buffer will be read and stored later. A call
to getsockopt() can now retrieve the leaked information.

To fix this problem the stack buffer given to copy_from_user() must be
initialized with the current settings.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/hci_sock.c
net/bluetooth/l2cap.c