Bluetooth: L2CAP ERTM shutdown protect sk and chan
During execution of l2cap_sock_shutdown() which might sleep, the sk and chan structures can be in an unlocked condition which potentially allows the structures to be freed by other running threads. Therefore, there is a possibility of a malfunction or memory reuse after being freed. Keep the sk and chan structures alive during the execution of l2cap_sock_shutdown() by using their respective hold and put functions. This allows the structures to be freeable at the end of l2cap_sock_shutdown(). Signed-off-by: NKautuk Consul <Kautuk_Consul@mentor.com> Signed-off-by: NDean Jenkins <Dean_Jenkins@mentor.com> Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
Showing
想要评论请 注册 或 登录