From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (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 549FE48A2D4 for ; Tue, 9 Jun 2026 15:49:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781020179; cv=none; b=ZdPgavX/jnbxTW+3/6fcnRoLoFUh/H3cbTBnUBdqwADFIOUIVarK8SjS2ilRVqgQzRyMBcwACl80H3GUgg8Aqdjy38wVOoW4hSEhR6jhz4Ib0+73fFqf439ZSZYP7KYyKBs5tb9MtLjJlFcbXylNdH+CpibPnG5NWOBsUHn5G1U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781020179; c=relaxed/simple; bh=Qwr/hZqRzkH9ex60NmaJsc8uWz0tZ5CnDSIKQlRcmTo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VlEizw120wyZAT1ZatpjiMKa8Lo+HZePBdl6TcNO9d/m+MzgD7rpSpv3slhthMQNuHgFjEz4TLI0HjNYFx7H0ri0+77HL6cKp95ngtwkWheHmMMUaBHd6wa0Mnsg72rHHB3qlmgTw5m5xBmLpTcqeye2CO19noGwuHibX+wSz6w= 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=hLALQtbr; arc=none smtp.client-ip=209.85.214.182 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="hLALQtbr" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-2c0c3546924so37989525ad.3 for ; Tue, 09 Jun 2026 08:49:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781020178; x=1781624978; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=d4HBzS3VR7L/xCwloqp54fznT7ikswGBTr+YHTCIylU=; b=hLALQtbrHrqwMRCXh6lLkNzAnIivRek3TF2nK+cp1ZwWd9WCcpMi+a8V90Ns15ihKh 9EDOXDQbcqvEM7wkEZydVM2tV7XsKYuShqxqzBa4wYH0V7uwr2Q6NPQsgY/LyX445Om6 suR7RscDb3WQlPkkPU4yhXkTHVr5sFIctlzIlQlO1rRBHZ61Ssnhj5f8+tGpH3Y9NwsF AB3YwcPgbAyJSO07JfjJPdHv/62H9Mmo4U37Ja949ptv604tMBYvT93b6zuEnVwGvVwc aHDVG8iriPR4wY7BI/YybDj1tqrqpj08HCGovLpSIeiI2v+XbMDRgChSIeLFNF6bq4cn aGiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781020178; x=1781624978; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d4HBzS3VR7L/xCwloqp54fznT7ikswGBTr+YHTCIylU=; b=VsVhXjHPN6n7oKIl+KDIPW7ejB7hF/zhQmPkMiZ8is777wOKlrbBNi+FxaV1xHxI+5 Ng+hAuY8rDunckiXHt12DvQ1V/zxhpUGnOWHPuYYgycySkd60oMszetaJ41alIliTLDp 6HcoJP0ZMJnyNN5hPj/mAPUvGQZGp7DTUTtoERyK6/QebeV1seGQXDiZkAOb8P4ua5j1 IlPcxrZD98h8JrEcAcvGLXtxay2gXWUeQFbVyivg1kjUorJvIhPdVGkbE+OLpZOwrjBi 5oQLEH8al9AidW8m9Yy0oGlzhFCPcVE5lKqYJStNsJwIa8T+yKR71UqmJcz/Q5nyoqGZ WXVQ== X-Forwarded-Encrypted: i=1; AFNElJ/lrxWkRQvuNOh5mVZrKJO/XvsowClGvpA7WgWTMt3bxYJhNuQdm0tyTLubiEu6k96nGhz8qW7tV7jWDmU=@vger.kernel.org X-Gm-Message-State: AOJu0YxqqIEq7SDjSjrLQ/XkpgYDN5x946/m5jq64JEpxJvQ5yTDytfM bna53Ojz9/UeLuifhy69w/OpU2Gc+udyUw0Na0t7T6Jk6UX9G9ebarW25vfe4B4z X-Gm-Gg: Acq92OEhmb+sRFi3MGH+VWmwxLi7VtaYoq1qJXUCkYm92DJq0AHqKVsUBuONrznc5E9 lzbOYzcnmRSi9vPfYlJVXxEqz39PcQrlqrDpaRoZ0jTKK8wra6ajtG3SIdWb3EYUSuojEXxu0NR PSO92iWm4A/Lq0KGactWJ3vxHXWvVepQfqShARBdeC6XIYB/2UMIJx7/WdhL9v5lsUqLB2VNs8x iYxF8t4hkCq9PkBxnnX7RzIIQz1unq8YFwNXLiEtqebGgZWEAqMtAs2RzBkYa5oMYO0ZjC/7KjR Cp00ES2bPUH1BPTN5b808lHZlw7QlhMiozRSAZ6AdvAWPd+VKbp1iLSs72JjRnZvVZ4+hfljjb+ aM7EDyaL5eZV7FXCj49wlqmih6W0d1WRVfhmiF0/GJXxHH8CR/aRwSWGQN979k8U3H/LgvaYG1k eQkH33eDj0HLJKpBHExUCF9zaqd3Zcfa8vSPZcBXKmm1nNV+2vg6a59nPVsp/3BA== X-Received: by 2002:a17:903:1b08:b0:2c0:f807:56b2 with SMTP id d9443c01a7336-2c1e8955cd3mr211063515ad.34.1781020177577; Tue, 09 Jun 2026 08:49:37 -0700 (PDT) Received: from Air.local ([198.176.50.157]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2c164f6d59csm207270485ad.4.2026.06.09.08.49.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2026 08:49:37 -0700 (PDT) Date: Tue, 9 Jun 2026 23:49:31 +0800 From: Weiming Shi To: Paolo Abeni Cc: 3chas3@gmail.com, netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, edumazet@google.com, horms@kernel.org, linux-atm-general@lists.sourceforge.net, linux-kernel@vger.kernel.org, xmei5@asu.edu Subject: Re: [PATCH net] net: atm: fix use-after-free in sigd_put_skb() Message-ID: References: <20260604164916.2681964-2-bestswngs@gmail.com> <20260609110615.196819-1-pabeni@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260609110615.196819-1-pabeni@redhat.com> On 26-06-09 13:06, Paolo Abeni wrote: > From: AI Reviewer > > 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() > > 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. > > > 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) > > > > static void sigd_put_skb(struct sk_buff *skb) > > { > > - if (!sigd) { > > + struct atm_vcc *vcc; > > + struct sock *sk; > > + > > + vcc = find_get_vcc(READ_ONCE(sigd)); > > [Severity: Critical] > Does this introduce a regression where an ABA vulnerability allows a KASLR > bypass if the daemon socket is freed and reallocated? > > 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. > > 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_get_vcc() > would match the raw pointer and return the attacker's new socket. > > 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. > > Because the message contains literal kernel pointers (vcc, listen_vcc), > wouldn't this allow an unprivileged KASLR bypass and message injection? > > [ ... ] > > [Severity: High] > This is a pre-existing issue, but does sigd_send() leak memory when queuing > SKBs to a closing listening socket? > > When processing an as_indicate message, sigd_send() resolves the listening > socket via msg->listen_vcc, acquires lock_sock(), and appends an SKB: > > 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); > ... > } > > Does this code blindly queue an SKB without checking if the socket has been > marked closed (ATM_VF_CLOSE) and already purged? > > If the listening socket is concurrently closed, vcc_release() will lock the > socket, purge its receive queue, mark it closed, and release the lock. > > Could sigd_send() then acquire the lock and append the new SKB to the dead > 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 allow > an attacker to exhaust kernel memory? > -- > This is an AI-generated review. > Thanks. The find_get_vcc() issue will be fixed in v2; the sigd_send() leak will be sent as a separate patch.