public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: syzbot <syzbot+f50072212ab792c86925@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Forwarded: Re: [PATCH] atm: lec: fix use-after-free in send_to_lecd
Date: Sun, 08 Mar 2026 22:24:30 -0700	[thread overview]
Message-ID: <69ae598e.a70a0220.52840.000c.GAE@google.com> (raw)
In-Reply-To: <69ad7ccb.a00a0220.b130.0003.GAE@google.com>

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: Re: [PATCH] atm: lec: fix use-after-free in send_to_lecd
Author: kartikey406@gmail.com

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
master

In send_to_lecd(), the socket is extracted via sk_atm(priv->lecd)
without holding a reference. The APIC timer triggers a softirq which
runs RCU callbacks, and if the RCU grace period has elapsed, the socket
can be freed via rcu_do_batch() while send_to_lecd() is still accessing
it, triggering a use-after-free bug.

Fix this by adding sock_hold() before accessing the socket and
sock_put() after all usage is done to prevent premature freeing.

Reported-by: syzbot+f50072212ab792c86925@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=f50072212ab792c86925
Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
---
 net/atm/lec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/atm/lec.c b/net/atm/lec.c
index fb93c6e1c329..4e752b4b623e 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -534,9 +534,9 @@ send_to_lecd(struct lec_priv *priv, atmlec_msg_type type,

        atm_force_charge(priv->lecd, skb->truesize);
        sk = sk_atm(priv->lecd);
+       sock_hold(sk);
        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);
@@ -544,6 +544,7 @@ send_to_lecd(struct lec_priv *priv, atmlec_msg_type type,
                sk->sk_data_ready(sk);
        }

+        sock_put(sk);
        return 0;
 }

--
2.43.0

  parent reply	other threads:[~2026-03-09  5:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-08 13:42 [syzbot] [net?] KASAN: slab-use-after-free Read in sock_def_readable (2) syzbot
2026-03-09  4:56 ` Forwarded: [PATCH] atm: lec: fix use-after-free in send_to_lecd syzbot
2026-03-09  5:24 ` syzbot [this message]
2026-03-09  6:28 ` Forwarded: [PATCH] atm: lec: fix use-after-free in sock_def_readable() syzbot
2026-03-09  7:02 ` syzbot
2026-03-09  7:53 ` syzbot
2026-03-09  8:21 ` syzbot
2026-03-09  9:20 ` [syzbot] [net?] KASAN: slab-use-after-free Read in sock_def_readable (2) Jiayuan Chen
2026-03-09  9:39   ` syzbot
2026-03-09 15:20 ` Forwarded: [PATCH] atm: lec: fix use-after-free in sock_def_readable() syzbot
2026-03-12  2:26 ` [syzbot] [net?] KASAN: slab-use-after-free Read in sock_def_readable (2) Hillf Danton
2026-03-12  2:46   ` syzbot
2026-03-12  6:35 ` Hillf Danton
2026-03-12  6:53   ` syzbot
2026-03-12  7:37 ` Hillf Danton
2026-03-12  7:57   ` syzbot
2026-03-12 22:02 ` Hillf Danton
2026-03-12 22:22   ` syzbot
2026-03-13 18:44 ` Hillf Danton
2026-03-13 19:02   ` syzbot

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=69ae598e.a70a0220.52840.000c.GAE@google.com \
    --to=syzbot+f50072212ab792c86925@syzkaller.appspotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzkaller-bugs@googlegroups.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