From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 80AC53E1D1B; Wed, 29 Apr 2026 13:37:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777469867; cv=none; b=bm4bhHTuie+6u+G+HOj7gxof7iVf2qPwOts2EIu3xG/VPOfbD8J3X9VmZ5RVYcpzILzLGioQ4Y+7sBMA2oKk+mL1QBGR4f0wY4GJr4ZcQR7o5sXnC/6H2CP+Zb16wLJSmiQQuzA+kJBDhn+dZY6Ky5UjgRAU0SYzlsSC7dyEzDs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777469867; c=relaxed/simple; bh=r3/HfxpR1X8NHyDwS440OBhOvPcMyYHsrYvctOYR5cg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=D8xcSEQI0gwafPVR5TolqhQeGqILEipkZU741LM5PhU8U3YRtee4YuhkRth8neo/cgLDAJWqFu7Xbg9LeTF4OU6Yzh53EwrOA4J9L33zGRE/iQO7LbQj/VDFOml5lV41qoRjwDhqh5lvsfqGqWcaHEMZtgB39h9blMnKHn7XrDc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hQ4Byc7h; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hQ4Byc7h" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49B94C19425; Wed, 29 Apr 2026 13:37:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777469867; bh=r3/HfxpR1X8NHyDwS440OBhOvPcMyYHsrYvctOYR5cg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hQ4Byc7hIU8/nsslh5edyDHZY5/f89eiKOox0Yu8ym9CXfa03dSXjX4epESeeo7g3 HR1oHVdGnEfieWQMHoTTETT3kAquKv7wSlgcDDiRlykVKZPS5cFYAfKtO/FzXk1YvL WtEXUbopLBZBFD4CwbmIE74Zd5UeSRdklpZhBvign9dxK7PxSyA6ZPYaRzLlqdG26g gTjtCyKgbUIN6uzIMwWi10Cx6DYdeRXNAsyCSPQSc3pTuV3/BUNRgE9ZSRR9rc8ofQ wwz8dwvTbf/hqELP+PtR5B5D97U8mXQZD3liUuegHGDVaDy1QPm1tgqIuA51Dxo/sF WbzeUCGqUjjww== Date: Wed, 29 Apr 2026 14:37:42 +0100 From: Lee Jones To: Eric Dumazet Cc: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Simon Horman , Kees Cook , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] nfc: llcp: fix use-after-free in llcp_sock_release() Message-ID: <20260429133742.GE1806155@google.com> References: <20260429132218.3548644-1-lee@kernel.org> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, 29 Apr 2026, Eric Dumazet wrote: > On Wed, Apr 29, 2026 at 6:22 AM Lee Jones wrote: > > > > llcp_sock_release() unconditionally unlinks the socket from the local > > sockets list. However, if the socket is still in connecting state, it > > is on the connecting list. > > > > Fix this by checking the socket state and unlinking from the correct list. > > > > Signed-off-by: Lee Jones > > --- > > net/nfc/llcp_sock.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/net/nfc/llcp_sock.c b/net/nfc/llcp_sock.c > > index f1be1e84f6653..feab29fc62f44 100644 > > --- a/net/nfc/llcp_sock.c > > +++ b/net/nfc/llcp_sock.c > > @@ -633,6 +633,8 @@ static int llcp_sock_release(struct socket *sock) > > > > if (sock->type == SOCK_RAW) > > nfc_llcp_sock_unlink(&local->raw_sockets, sk); > > + else if (sk->sk_state == LLCP_CONNECTING) > > + nfc_llcp_sock_unlink(&local->connecting_sockets, sk); > > else > > nfc_llcp_sock_unlink(&local->sockets, sk); > > > > -- > > 2.54.0.545.g6539524ca2-goog > > > > Why are you sending this patch a second time? Because I am a dunce and forgot to clear out my send cache before sending a related but different patch. > You forgot to add a Fixes: tag, as requested for all networking patches. No problem. Please ignore both of these and I'll follow-up with a coherent set with `Fixes:` tags applied. -- Lee Jones