mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Abeni <pabeni@redhat.com>
To: Jiakai Xu <xujiakai24@mails.ucas.ac.cn>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Cc: "David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Simon Horman <horms@kernel.org>
Subject: Re: [PATCH] llc: Fix NULL pointer dereference in llc_conn_state_process() when sk_socket is NULL
Date: Thu, 28 May 2026 12:55:35 +0200	[thread overview]
Message-ID: <5783055b-60e9-4e54-a17d-79b5e8f64fb6@redhat.com> (raw)
In-Reply-To: <20260526013541.796307-1-xujiakai24@mails.ucas.ac.cn>

On 5/26/26 3:35 AM, Jiakai Xu wrote:
> diff --git a/net/llc/llc_conn.c b/net/llc/llc_conn.c
> index 5c0ac243b248f..de65c452f6e68 100644
> --- a/net/llc/llc_conn.c
> +++ b/net/llc/llc_conn.c
> @@ -101,7 +101,8 @@ int llc_conn_state_process(struct sock *sk, struct sk_buff *skb)
>  	case LLC_DISC_PRIM:
>  		sock_hold(sk);
>  		if (sk->sk_type == SOCK_STREAM &&
> -		    sk->sk_state == TCP_ESTABLISHED) {
> +		    sk->sk_state == TCP_ESTABLISHED &&
> +		    sk->sk_socket) {
>  			sk->sk_shutdown       = SHUTDOWN_MASK;
>  			sk->sk_socket->state  = SS_UNCONNECTED;

sk orphaning happens outside the sk socket lock, and before the timer is
cancelled. sk_socket can still be cleared after the previous check and
before this access. You probably need to move the sock_orphan() call in
lc_sk_free(), after stopping the timers.

/P


  reply	other threads:[~2026-05-28 10:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-26  1:35 Jiakai Xu
2026-05-28 10:55 ` Paolo Abeni [this message]
2026-05-29  1:19   ` Jiakai Xu

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=5783055b-60e9-4e54-a17d-79b5e8f64fb6@redhat.com \
    --to=pabeni@redhat.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=xujiakai24@mails.ucas.ac.cn \
    /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®