mirror of
https://github.com/torvalds/linux.git
synced 2026-11-25 07:52:34 +00:00
The commits08c30aca9e"Bluetooth: Remove RFCOMM session refcnt" and8ff52f7d04"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 <[email protected]> Signed-off-by: Vitaly Kuzmichev <[email protected]> Acked-by: Dean Jenkins <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]> Cc: [email protected]