Bluetooth: Fix potential bad memory access with sysfs files
commite1c20f724d1f9f857dee1a13d0ecc11c4b834db7
authorMarcel Holtmann <marcel@holtmann.org>
Mon, 15 Mar 2010 21:12:58 +0000 (15 14:12 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 1 Apr 2010 22:58:54 +0000 (1 15:58 -0700)
tree3d9b06deab179f2b038a66aeb72a54ad68aa06a1
parent5bc44b4059b09f5035c7dbbf13552de42ac73f6a
Bluetooth: Fix potential bad memory access with sysfs files

commit 101545f6fef4a0a3ea8daf0b5b880df2c6a92a69 upstream.

When creating a high number of Bluetooth sockets (L2CAP, SCO
and RFCOMM) it is possible to scribble repeatedly on arbitrary
pages of memory. Ensure that the content of these sysfs files is
always less than one page. Even if this means truncating. The
files in question are scheduled to be moved over to debugfs in
the future anyway.

Based on initial patches from Neil Brown and Linus Torvalds

Reported-by: Neil Brown <neilb@suse.de>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/bluetooth/l2cap.c
net/bluetooth/rfcomm/core.c
net/bluetooth/rfcomm/sock.c
net/bluetooth/sco.c