From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f72.google.com (mail-oa1-f72.google.com [209.85.160.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC1A415746F for ; Sun, 19 Apr 2026 16:07:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.72 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776614873; cv=none; b=klJOO5CL4+OOPl/r8wLnmMN0k5j8shTq34xxHrzed9ZALaY3grMBfEWKqmfxPKpyQVhnqTzy0P3xU1Pqf28r9KEe6+ly9KnPN84GFXY8L6XXRXfFPvxMPI7+uFgOcwKmcJjJEVUwpmkbsEWz1+m4nu2dK/dr6RQo0hIWC61xxic= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776614873; c=relaxed/simple; bh=ssvGZtKaL1fDgKDL6rhQe1WGp6eawjNXrrEN9w19ORY=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To:Cc: Content-Type; b=a2BRm09MDuh10jxxvcD+Z750UsOx/WcuxGi2yRp5dD34Ps5s9jLd/kD1Rkps+TWzk8l3EEz1UmjuDiwbnN7FOfOBmuy7jluyRUYzqJENmRoeiLgMoCeHFtZjawiPLx+67+CZoSwJX7GbTxDcLXB2yOQk7W+ZBtF7q6i8xoszp/k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.160.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oa1-f72.google.com with SMTP id 586e51a60fabf-40a4d2264abso3158826fac.2 for ; Sun, 19 Apr 2026 09:07:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776614871; x=1777219671; h=cc:to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yABZLUhwgeUFxGE6wZSoAnm+Y9OV/dPyrrVLCxMgUvE=; b=oWOXGH5e85DVxah6lE6deFqdCIebetEW+uC79tCKtG0zQRn6JcsjYz/zKdA5ZXQLp3 CNMnv4KvT4nZlt10ZV2kFCBMnD3fSFJl1bLxkKEClFJcn4kUCgKaWLII2z11dCtVEVOq x5d56WsDK35Qg/Qvo3EGiSeZKyf7aPA6JKe6b9HBmu9bU71zhFhcxcEZ2LcsGQxVtIhT UHJCmvVMMj8oC8blm4BQSZogqnSxWXM1TH+pQqzomYcIR6OkiR5xadtxIKwsE+55vZx3 fUkHQEvDQ1aRoEmotx1qGSXmNvqwa2jdXD4U3bkOMmerFbA4o/hEDP1jPFuCCB/ZUy/9 323w== X-Forwarded-Encrypted: i=1; AFNElJ8zTu95H1SYHJYvsmWTuorhzVfCge5/RcYO1cIyy+7myENHwgwDGfYhPW0AteLkagG8GY5JtzxbBiSMTho=@vger.kernel.org X-Gm-Message-State: AOJu0YwfJpV6gWsvkAgoBb/bpj/p7gtmY7r3iQSqxATXjLsMmP5TmGhb 7DPOhYS9T2LeiPKTiTmi/lLzYmQa+LGmb0Fn7ldb5J8iq2TkREZLgo5ClIUiwCz1cg0NY1T+igM D1B623A7jx8PeKFNX3RBRZHOfD+lOJDzz7A4l6WaX7SbzpDHBFq0Ogb13LsM= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:6ad0:b0:68e:d9b7:7a29 with SMTP id 006d021491bc7-69462f5351emr5800476eaf.52.1776614870794; Sun, 19 Apr 2026 09:07:50 -0700 (PDT) Date: Sun, 19 Apr 2026 09:07:50 -0700 In-Reply-To: X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69e4fdd6.a00a0220.1bd0ca.005a.GAE@google.com> Subject: Re: [syzbot] [net?] KASAN: null-ptr-deref Write in send_to_lecd From: syzbot To: s9430939@naver.com Cc: s9430939@naver.com, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" > #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 014441d1e4b2 This crash does not have a reproducer. I cannot test it. > > net: atm: lec: fix null-ptr-deref in send_to_lecd > > A null pointer dereference occurs in send_to_lecd() when accessing > priv->lecd. Although priv->lecd is checked at the function's entry, > it can be cleared by lec_atm_close() before it is actually used. > > Use READ_ONCE() to load priv->lecd into a local variable and check > it before use. > > Reported-by: syzbot+e1d2b89a60c8bb9a7f33@syzkaller.appspotmail.com > Closes: https://syzkaller.appspot.com/bug?extid=e1d2b89a60c8bb9a7f33 > Signed-off-by: Minu Jin > > --- > net/atm/lec.c | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) > > diff --git a/net/atm/lec.c b/net/atm/lec.c > index fb93c6e1c329..34f4c32acadb 100644 > --- a/net/atm/lec.c > +++ b/net/atm/lec.c > @@ -512,10 +512,16 @@ send_to_lecd(struct lec_priv *priv, atmlec_msg_type type, > { > struct sock *sk; > struct sk_buff *skb; > + struct atm_vcc *lecd; > struct atmlec_msg *mesg; > > - if (!priv || !priv->lecd) > + if (!priv) > return -1; > + > + lecd = READ_ONCE(priv->lecd); > + if (!lecd) > + return -1; > + > skb = alloc_skb(sizeof(struct atmlec_msg), GFP_ATOMIC); > if (!skb) > return -1; > @@ -532,14 +538,14 @@ send_to_lecd(struct lec_priv *priv, atmlec_msg_type type, > if (atm_addr) > memcpy(&mesg->content.normal.atm_addr, atm_addr, ATM_ESA_LEN); > > - atm_force_charge(priv->lecd, skb->truesize); > - sk = sk_atm(priv->lecd); > + atm_force_charge(lecd, skb->truesize); > + sk = sk_atm(lecd); > skb_queue_tail(&sk->sk_receive_queue, skb); > sk->sk_data_ready(sk); > > if (data != NULL) { > pr_debug("about to send %d bytes of data\n", data->len); > - atm_force_charge(priv->lecd, data->truesize); > + atm_force_charge(lecd, data->truesize); > skb_queue_tail(&sk->sk_receive_queue, data); > sk->sk_data_ready(sk); > } > -- > 2.43.0