From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f45.google.com (mail-dl1-f45.google.com [74.125.82.45]) (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 1342D3403E1 for ; Thu, 11 Jun 2026 16:45:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781196315; cv=none; b=Ds0DABN9Ovq93QtiQOHS2vlQfG+EdkNN0x5i0+B/UQICCFoTn12sfCLIawa9hX3FoxHTZly5P2Iruypaq3dyGwqn1cix1f84uEDgyvbgKLHfYVU3iKuPJxX1ilBwyT9i489Oq6ToBo6HMOza3PjG7i38/PjkaHrzlidM9x3aHcw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781196315; c=relaxed/simple; bh=eoDaWDBXYJeLcDF9mSfKTCRaUJsOMqahefPGRT0/AGU=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:From:To:Cc: References:In-Reply-To; b=qgZJP6+QuSUyTaKoVyN+yCLCy4SPz5Iacl3V4bQfTudEZ3CYM8R53vbRflJRKRtEVbpjIUfsNzKYzLxI7GpEKDMYKLpJVQ+0QisuxtjXfYXRdfEBsMNnQ3EZvy1MzXm+RHEuvDlWj51L6RbMTjhFMTJQWHadJFqE1ryKujgzmoo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Cj1fokFh; arc=none smtp.client-ip=74.125.82.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Cj1fokFh" Received: by mail-dl1-f45.google.com with SMTP id a92af1059eb24-13721dfd471so4105c88.1 for ; Thu, 11 Jun 2026 09:45:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781196313; x=1781801113; darn=vger.kernel.org; h=in-reply-to:references:cc:to:from:subject:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=kvWDNY3Gjw9OYKYBFLQFihLG0PJK2utsvZ3byDHLtuI=; b=Cj1fokFhVhgPQJ3RcWu5jnBJDmj1TApQnI28qnXEbJgWRVZvAZxVndqz2x+Tljsa4A Q2IW2rpe+rCCEf8+sZBFRBoQuSudzSfQJktD0X7fYp/V24l2riQIz+MZlrySR4BmKFOZ 0iZfrJPzwdqOJqKZOzfh7PWOsD3S80opcKrW6a+kt8/xok2AjvljoSy2vcHydHK/TqkI /r9rIPTq6IRATerP1IVnISBP4R5/U0U7iPeJqLsTa2l7ITIupVjcpQlGfF79WH8UheC4 SiWEZyIhoBaMCotyJD881qXTsDdIAQtB2VvVR6XdkGULINGklV+ZdLli5CmKwec6ho4K LGUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781196313; x=1781801113; h=in-reply-to:references:cc:to:from:subject:message-id:date :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=kvWDNY3Gjw9OYKYBFLQFihLG0PJK2utsvZ3byDHLtuI=; b=o4Ca5pBSDCtSOAADlTtgvqzNeqxWB5iXivQJe6z7IDGlrd4fKlRcvKuvu3mGHNUHQr R1nBsWPSQ5lp2KHMGM5sxgiCuCOu8I5OhQv/cYDVAS+auI4ZNWoX4ANLVjkOAvUFOg6+ 01UkzjkmlM7qVBPmq4JPW+V2doFa2jukuDe5ipWbmCRguiLuZmVrt/3Lh2SRlbuP0fGg Qq/5aYH31EMFe2NBWw44RY3Waif8VI9yFwmA7qSufCjyTkvt3fm8zJGxdhdF8OP32QiT eEZa+yMIv6KJPbV9e9DGFrM9WMFaRgCIb24Z2p0LtEbRuHUncWF2/7E6aNpHIyu+PCW6 9aEg== X-Forwarded-Encrypted: i=1; AFNElJ9FA6AeW7gHOMnOo2CW98GsQG+Q45WkX99xW+72A9jWXhY2FhUm6ONC8Wk6dM+OJrEC8ipv2HJpoVfVThE=@vger.kernel.org X-Gm-Message-State: AOJu0Yy9e7o5e+869j8Ud2XxxmNp8yMCi0GkJLAe519TKFwVXz5fm4jc ip7kRh/KO2pZLuRDk59DKtTutUyWBNZuy2Kn44opRXiMCUWN8TRcqb3G X-Gm-Gg: Acq92OFpwyBJaQrSbT97m1hAm3+xwWEcoYna1XrNsAplH0nFeVLmN7Ez9/U0gizTPPm cNcRR4/A4flSglsy/hAz8jZSApvdzSrle31qR0b4dGsRCvxRVfFe7gTRaVgCcPRA86lFP0axQRV UrwBbFwGxsPSdWiwmGxMmNe6Hp/oft/yCiLLF4NiVW395tN5KWxdutBYySLl7y1IM3L2G/lGEYe /2U7ugLOg02b1se6WD/7kxjTh4Pg7p8mq+0oc+8LKuCKB5IjWzumuzIa5HJC9bsXj/Yi7luKAp8 XFFYfXeFfMtLWLuJnIMcBEp9HOfobD8kcvweKRkOgUm5L93IESog+XWU+BhcZLORiHCWmCxVebS VYfEzOSPb1kz51c1+YebN2ShfDY50CF64LdlajPxdIRIjAX1SyAGfDHSQTKT+j4ToByxVYeiiKx 5BiJAnoM5o/KTO5oJqolJq2tKZI19SM61AwPKqWCLtQYB47QeE1cY= X-Received: by 2002:a05:7022:fd04:b0:138:1569:6f1 with SMTP id a92af1059eb24-13842164222mr2295767c88.11.1781196312961; Thu, 11 Jun 2026 09:45:12 -0700 (PDT) Received: from localhost ([198.176.50.157]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-138430452a2sm2324929c88.14.2026.06.11.09.45.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Jun 2026 09:45:11 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 12 Jun 2026 00:45:07 +0800 Message-Id: Subject: Re: [PATCH net] net: atm: fix use-after-free in sigd_put_skb() From: "Weiming Shi" To: "Weiming Shi" , "Paolo Abeni" Cc: <3chas3@gmail.com>, , , , , , , , X-Mailer: aerc 0.21.0 References: <20260604164916.2681964-2-bestswngs@gmail.com> <20260609110615.196819-1-pabeni@redhat.com> In-Reply-To: On Tue Jun 9, 2026 at 11:49 PM CST, Weiming Shi wrote: > On 26-06-09 13:06, Paolo Abeni wrote: >> From: AI Reviewer >>=20 >> This is an AI-generated review of your patch. The human sending this >> email has considered the AI review valid, or at least plausible. >> Full review at: https://sashiko.dev/ >> --- >> net: atm: fix use-after-free in sigd_put_skb() >>=20 >> This commit addresses a use-after-free in sigd_put_skb() by pinning the >> socket with find_get_vcc() and checking if it is marked SOCK_DEAD under >> the callback lock. >>=20 >> > diff --git a/net/atm/signaling.c b/net/atm/signaling.c >> > index b991d937205af..3dbe8e0fdc9af 100644 >> > --- a/net/atm/signaling.c >> > +++ b/net/atm/signaling.c >> > @@ -54,14 +54,31 @@ static struct atm_vcc *find_get_vcc(struct atm_vcc= *vcc) >> > =20 >> > static void sigd_put_skb(struct sk_buff *skb) >> > { >> > - if (!sigd) { >> > + struct atm_vcc *vcc; >> > + struct sock *sk; >> > + >> > + vcc =3D find_get_vcc(READ_ONCE(sigd)); >>=20 >> [Severity: Critical] >> Does this introduce a regression where an ABA vulnerability allows a KAS= LR >> bypass if the daemon socket is freed and reallocated? >>=20 >> If the signaling daemon is closed, sigd is cleared and the socket freed,= but >> an unprivileged thread in sigd_put_skb() might have already latched the = old >> sigd pointer. >>=20 >> If an unprivileged user subsequently creates a new ATM socket, couldn't = the >> slab allocator reuse the exact same memory address? In this case, find_g= et_vcc() >> would match the raw pointer and return the attacker's new socket. >>=20 >> Since the attacker's socket isn't marked SOCK_DEAD, sigd_put_skb() would= blindly >> enqueue the signaling message to the attacker's receive queue. >>=20 >> Because the message contains literal kernel pointers (vcc, listen_vcc), >> wouldn't this allow an unprivileged KASLR bypass and message injection? >>=20 >> [ ... ] >>=20 >> [Severity: High] >> This is a pre-existing issue, but does sigd_send() leak memory when queu= ing >> SKBs to a closing listening socket? >>=20 >> When processing an as_indicate message, sigd_send() resolves the listeni= ng >> socket via msg->listen_vcc, acquires lock_sock(), and appends an SKB: >>=20 >> net/atm/signaling.c:sigd_send() { >> ... >> lock_sock(sk); >> if (sk_acceptq_is_full(sk)) { >> ... >> } >> sk_acceptq_added(sk); >> skb_queue_tail(&sk->sk_receive_queue, skb); >> ... >> } >>=20 >> Does this code blindly queue an SKB without checking if the socket has b= een >> marked closed (ATM_VF_CLOSE) and already purged? >>=20 >> If the listening socket is concurrently closed, vcc_release() will lock = the >> socket, purge its receive queue, mark it closed, and release the lock. >>=20 >> Could sigd_send() then acquire the lock and append the new SKB to the de= ad >> socket's receive queue? Since sk_free() expects an empty queue and does = not >> purge it during memory free, would this permanently leak the SKB and all= ow >> an attacker to exhaust kernel memory? >> --=20 >> This is an AI-generated review. >>=20 > > Thanks. The find_get_vcc() issue will be fixed in v2; the sigd_send() > leak will be sent as a separate patch. Hi Paolo, This is the link to the fix for the above bug. v2: https://lore.kernel.org/all/DJ6D0B3KSMYU.1KE7UIQCA7K2N@gmail.com/ leak memory fix: https://lore.kernel.org/all/20260611163805.2151734-2-bests= wngs@gmail.com/ Best, Weiming Shi