Re: [PATCH net-next v3 2/9] Bluetooth: L2CAP: do not leave dangling sk pointer on error in l2cap_sock_create()

2024-10-15 Thread Eric Dumazet
On Mon, Oct 14, 2024 at 11:23 PM Kuniyuki Iwashima wrote: > > From: Ignat Korchagin > Date: Mon, 14 Oct 2024 16:38:01 +0100 > > bt_sock_alloc() allocates the sk object and attaches it to the provided > > sock object. On error l2cap_sock_alloc() frees the sk object, but the > > dangling pointer is

Re: [PATCH net-next v3 2/9] Bluetooth: L2CAP: do not leave dangling sk pointer on error in l2cap_sock_create()

2024-10-14 Thread Kuniyuki Iwashima
From: Ignat Korchagin Date: Mon, 14 Oct 2024 16:38:01 +0100 > bt_sock_alloc() allocates the sk object and attaches it to the provided > sock object. On error l2cap_sock_alloc() frees the sk object, but the > dangling pointer is still attached to the sock object, which may create > use-after-free i

[PATCH net-next v3 2/9] Bluetooth: L2CAP: do not leave dangling sk pointer on error in l2cap_sock_create()

2024-10-14 Thread Ignat Korchagin
bt_sock_alloc() allocates the sk object and attaches it to the provided sock object. On error l2cap_sock_alloc() frees the sk object, but the dangling pointer is still attached to the sock object, which may create use-after-free in other code. Signed-off-by: Ignat Korchagin --- net/bluetooth/l2c