From: Andrew Lunn <andrew@lunn.ch>
To: Biancaa Ramesh <biancaa2210329@ssn.edu.in>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Signed-off-by: Biancaa Ramesh <biancaa2210329@ssn.edu.in>
Date: Wed, 22 Oct 2025 21:41:44 +0200 [thread overview]
Message-ID: <8b8e75f7-8fc2-41c9-b5ec-596552b1b0d9@lunn.ch> (raw)
In-Reply-To: <20251022172045.57132-1-biancaa2210329@ssn.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
next prev parent reply other threads:[~2025-10-22 19:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-22 17:20 Biancaa Ramesh
2025-10-22 19:41 ` Andrew Lunn [this message]
2025-10-22 21:42 ` [syzbot ci] " syzbot ci
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8b8e75f7-8fc2-41c9-b5ec-596552b1b0d9@lunn.ch \
--to=andrew@lunn.ch \
--cc=biancaa2210329@ssn.edu.in \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®