From nobody Thu Apr 9 12:06:18 2026 Received: from mail-oi1-f198.google.com (mail-oi1-f198.google.com [209.85.167.198]) (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 2D3C82E889C for ; Mon, 9 Mar 2026 05:24:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.198 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773033872; cv=none; b=kkDBo43vDQZTc3AW6X7px7ZePbD/pv0osk6HXyauhTw104/ljl0o3Gvcf3agx8cMPNozAKsKAt4MS3VHsXo6Rs3EIDfrl0qFx0mNWoInsVTsBSY0QVdjLr4BU6ayQxryaDKrvYr7E2UhZiwr/676BxnR9ZZ8cr1DvX/zOM5gllg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773033872; c=relaxed/simple; bh=vgXLgoDmyiQIO0MzamQeYxvhCnz1/goplXao4JS11aA=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=lOpiADXt9c5ow7YCrtOvRHOkBWnjxDAExwV16vmgROkO51tGWi7KmELX/TBu2tz/TOVl4sj/2AiprGRZvvMHmTAoNsVCiyglGCd7kinVZGPfC5j18aeBuPK6KVrFQbFypvhYrFqd+ONPbhwrRZvl4lE6OCtT2s06Zp/FGsSsyqg= 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.167.198 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-oi1-f198.google.com with SMTP id 5614622812f47-45f16aa81a8so159525788b6e.1 for ; Sun, 08 Mar 2026 22:24:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773033870; x=1773638670; h=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=h6d3XEP58pKE2mxT1kFPWAA07RVKySlY/H+SYwsoypQ=; b=jqw36glqWFhzwVWYW2vm7jyDhog65KKNN7APPc2bgkXALuuS9z43QrjaeD6PPm2h6A lH+ML2nxTG4LeLzkjV6bAur095IMnMvpIT3lYAdN1OsePwZ2UY8HrOhn+j9aQZTmwMYl SFwlg3JfFY+JLyC1Ie1Lvv2mZ9ptsphw+rGy9Bkw2Bjt57B3ri1HwtrdGAa6GIWmhmwF G70MyPeuBBkNYDK3G9JyPvm6cb7O0pdN/jPtl7xSc4oB51yLKO1EUsZBmir9a74KLLj2 xPb8bthGx/NWLcmDci4EDuOby+mn6kPcBIfSaCztD8qhmSqYKF2hC0BAMv1Xn11H7sId kPVQ== X-Gm-Message-State: AOJu0YzU3OkVVpsr9zP6fV1rHbTeTQs9wtJw09DYNnqKeRAQx0lCxTpk rYuuaxK1AExU8l1vZTH9nwLrDy9KU3IZkJzLv3chK9AQt0A4k+u9f0g8mvs1gjxxD0fYVdTpXKe h+dvhlbQPOB+bayTPngXKseuhuBLWrByH/PJt/aekevPVZxdtQZNsH1/7plM= 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:827:b0:67b:b74c:8f59 with SMTP id 006d021491bc7-67bb74c96famr478229eaf.1.1773033870166; Sun, 08 Mar 2026 22:24:30 -0700 (PDT) Date: Sun, 08 Mar 2026 22:24:30 -0700 In-Reply-To: <69ad7ccb.a00a0220.b130.0003.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69ae598e.a70a0220.52840.000c.GAE@google.com> Subject: Forwarded: Re: [PATCH] atm: lec: fix use-after-free in send_to_lecd From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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=3Df50072212ab792c86925 Signed-off-by: Deepanshu Kartikey --- 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 typ= e, atm_force_charge(priv->lecd, skb->truesize); sk =3D sk_atm(priv->lecd); + sock_hold(sk); skb_queue_tail(&sk->sk_receive_queue, skb); sk->sk_data_ready(sk); - if (data !=3D 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 typ= e, sk->sk_data_ready(sk); } + sock_put(sk); return 0; } -- 2.43.0