[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8b8e75f7-8fc2-41c9-b5ec-596552b1b0d9@lunn.ch>
Date: Wed, 22 Oct 2025 21:41:44 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Biancaa Ramesh <biancaa2210329@....edu.in>
Cc: davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Signed-off-by: Biancaa Ramesh <biancaa2210329@....edu.in>
On Wed, Oct 22, 2025 at 10:50:45PM +0530, Biancaa Ramesh wrote:
> net/llc: add socket locking in llc_conn_state_process to fix race conditions
>
> The llc_conn_state_process function handles LLC socket state transitions and is called from timer callbacks and network packet processing.
>
> Currently, there is a race condition due to concurrent access to the LLC socket's state machine and connection state without proper locking. This causes use-after-free, array out-of-bounds, and general protection faults due to invalid concurrent state access.
>
> This patch adds socket bottom-half locking (bh_lock_sock and bh_unlock_sock) around the call to llc_conn_service() in llc_conn_state_process. This serializes access to the LLC state machine and protects against races with LLC socket freeing and timer callbacks.
>
> It complements existing fixes that lock the socket during socket freeing (llc_sk_free) and timer cancellation.
>
> This fix prevents Kernel Address Sanitizer (KASAN) null pointer dereferences, Undefined Behavior Sanitizer (UBSAN) array index out-of-bounds, and rare kernel panics due to LLC state races.
>
> Reported-by: syzbot
Please take a look at
https://docs.kernel.org/process/submitting-patches.html
> ::DISCLAIMER::
>
> ---------------------------------------------------------------------
> The
> contents of this e-mail and any attachment(s) are confidential and
> intended
> for the named recipient(s) only. Views or opinions, if any,
> presented in
> this email are solely those of the author and may not
> necessarily reflect
> the views or opinions of SSN Institutions (SSN) or its
> affiliates. Any form
> of reproduction, dissemination, copying, disclosure,
> modification,
> distribution and / or publication of this message without the
> prior written
> consent of authorized representative of SSN is strictly
> prohibited.
FYI, this email will be archived, and be publically available for
approximately forever, which probably goes against this policy. Your
best bet is to remove the disclaimer, if you want anybody to actually
look at your patches.
Andrew
Powered by blists - more mailing lists