]> git.baikalelectronics.ru Git - kernel.git/commit
Bluetooth: Avoid use of session socket after the session gets freed
authorVignesh Raman <Vignesh_Raman@mentor.com>
Tue, 22 Jul 2014 13:54:25 +0000 (19:24 +0530)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 22 Jul 2014 14:07:31 +0000 (16:07 +0200)
commit03190db154b2928d20e55f89f8a8688ff51c7b88
tree3ff5cec73569dde9741d04af5edbc6f0df5a0bb4
parent17650362c75f87090ae9ec7543cb361bdcf5ce5a
Bluetooth: Avoid use of session socket after the session gets freed

The commits a7f72c728604def1f0707a781a1c6397c2b0cb20 "Bluetooth: Remove
RFCOMM session refcnt" and 08067551c7c96c62c9394e618fd6ef45cf27ad5d
"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>
Cc: stable@vger.kernel.org
net/bluetooth/rfcomm/core.c