linux/net/bluetooth/rfcomm
Vignesh Raman 37fada67e1 Bluetooth: Avoid use of session socket after the session gets freed
commit 32333edb82 upstream.

The commits 08c30aca9e "Bluetooth: Remove
RFCOMM session refcnt" and 8ff52f7d04
"Bluetooth: Return RFCOMM session ptrs to avoid freed session"
allow rfcomm_recv_ua and rfcomm_session_close to delete the session
(and free the corresponding socket) and propagate NULL session pointer
to the upper callers.

Additional fix is required to terminate the loop in rfcomm_process_rx
function to avoid use of freed 'sk' memory.

The issue is only reproducible with kernel option CONFIG_PAGE_POISONING
enabled making freed memory being changed and filled up with fixed char
value used to unmask use-after-free issues.

Signed-off-by: Vignesh Raman <Vignesh_Raman@mentor.com>
Signed-off-by: Vitaly Kuzmichev <Vitaly_Kuzmichev@mentor.com>
Acked-by: Dean Jenkins <Dean_Jenkins@mentor.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-17 09:19:23 -07:00
..
Kconfig tty: Added a CONFIG_TTY option to allow removal of TTY 2013-01-18 16:15:27 -08:00
Makefile [Bluetooth] Move CRC table into RFCOMM core 2005-10-28 19:20:36 +02:00
core.c Bluetooth: Avoid use of session socket after the session gets freed 2014-09-17 09:19:23 -07:00
sock.c Bluetooth: never linger on process exit 2014-09-17 09:19:22 -07:00
tty.c Bluetooth: Remove rfcomm_carrier_raised() 2014-01-06 13:51:45 -08:00