Thread (31 messages) 31 messages, 7 authors, 2024-10-16

Re: [PATCH net-next v3 3/9] Bluetooth: RFCOMM: avoid leaving dangling sk pointer in rfcomm_sock_alloc()

flat view

From: Eric Dumazet <hidden>
Date: 2024-10-15 08:04:23
Also in: linux-bluetooth, linux-can, lkml

On Mon, Oct 14, 2024 at 11:30 PM Kuniyuki Iwashima [off-list ref] wrote:
From: Ignat Korchagin <redacted>
Date: Mon, 14 Oct 2024 16:38:02 +0100
quoted
bt_sock_alloc() attaches allocated sk object to the provided sock object.
If rfcomm_dlc_alloc() fails, we release the sk object, but leave the
dangling pointer in the sock object, which may cause use-after-free.

Fix this by swapping calls to bt_sock_alloc() and rfcomm_dlc_alloc().

Signed-off-by: Ignat Korchagin <redacted>
Reviewed-by: Kuniyuki Iwashima <redacted>
Reviewed-by: Eric Dumazet <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help