Received: from fout-b2-smtp.messagingengine.com (fout-b2-smtp.messagingengine.com [202.12.124.145]) (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 A652E312819 for ; Fri, 12 Jun 2026 14:35:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.145 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781274919; cv=none; b=JwQLJT+N1vv7n5+1bmBZ2H0b83VUUauCXcrK/mnEADtgO9YgbcaXDWm7vZt3hOwr7CnOTiP7mSq2MeUIT1zzlkK8ULL+8vs4hiOtVyRq6eGwoq6g6ZjfZMD+V1sTn0bUDtIXckuu+E2WWjY3diE+V5JDxRU8L9w02bwyfhl8ZEo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781274919; c=relaxed/simple; bh=IDByotaC80HObteyFucUck8JEoCTO3ZeuaF901zLIWE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=FRgNERC+uaUl/67qxJn8aZV+XObz9ZGfaRSr6DjdGaRvV1RK8qsAeDf2EllrwM6/JuDDIDTzL82Q6a1BW22KFPSB1LhFUBm6sX3jVetQoze4TuqMFupeTxGtXv2o1wSlW9PikNHbgEd30L1PyDx4+cpcjKJrYhwirCIRIcm9Iic= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fourdim.xyz; spf=pass smtp.mailfrom=fourdim.xyz; dkim=pass (2048-bit key) header.d=fourdim.xyz header.i=@fourdim.xyz header.b=CdABEfVG; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=HvIZEFL4; arc=none smtp.client-ip=202.12.124.145 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fourdim.xyz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fourdim.xyz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=fourdim.xyz header.i=@fourdim.xyz header.b="CdABEfVG"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="HvIZEFL4" Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfout.stl.internal (Postfix) with ESMTP id BA3451D00197; Fri, 12 Jun 2026 10:35:16 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-10.internal (MEProxy); Fri, 12 Jun 2026 10:35:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fourdim.xyz; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to; s=fm3; t=1781274916; x=1781361316; bh=ryFjvBhAX9M3U4WL2fcfp Y8v8xHYRqgw3JVkGF2wxkM=; b=CdABEfVGXAlJMtoKYWy8wnVhWledtwD1+8CnI d3P2dp6qs1vDBsstarK8eddPylhf71KwZi+zNkpIdvb6DuIWpqitvC9OKk3bzfTz 6TT4qjitsVTycz1hh/w7x1zumK4V0i9dOiMAszImdL/ZO283/SZwef5uihm3Ysoo MDKtG+C1uTCk/bsPhF6QI3BQ3EEboH6Md1wMaTwiFdtaDQXf1ABpUCGbun8rnfYJ ly7HErwO2aDGPf3TSUvBBsJ8uvxOmmHRFfheR/D8g/FkVNuD49iTMmWfm1lu569U Zz1nrDmUYnsUFDZk/JuIG0KwvcTWIUCu7SzeiEjVw7cbqh8Cw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1781274916; x=1781361316; bh=ryFjvBhAX9M3U4WL2fcfpY8v8xHYRqgw3JV kGF2wxkM=; b=Hv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ME-Proxy: Feedback-ID: if72e4b10:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 12 Jun 2026 10:35:16 -0400 (EDT) From: Siwei Zhang To: Luiz Augusto von Dentz Cc: linux-bluetooth@vger.kernel.org, Siwei Zhang Subject: [PATCH v11 0/1] Bluetooth: L2CAP: Fix use-after-free in l2cap_sock_new_connection_cb() Date: Fri, 12 Jun 2026 10:34:26 -0400 Message-ID: <20260612143449.3045055-1-oss@fourdim.xyz> X-Mailer: git-send-email 2.54.0 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Compared to v2, addresses comments on https://sashiko.dev/#/patchset/20260415204842.2363950-1-oss%40fourdim.xyz . Compared to v3, rebase against bluetooth-next. Compared to v4, allocate the channel outside the function and pass it in as an argument to avoid the use-after-free. Compared to v5, extract the channel init to a separate function. Compared to v6, balance puts and holds on chans. Compared to v7, rebase against bluetooth-next and refactor the chan refcounting. Compared to v8, adopt the philosophy of one assignment one reference. Make refcounting easier to follow. Compared to v9, rework on l2cap_chan_set_defaults so that new chan's default comes from pchan and can be used by __l2cap_chan_add. Compared to v10, rebase against bluetooth-next. Siwei Zhang (1): Bluetooth: L2CAP: Fix use-after-free in l2cap_sock_new_connection_cb() include/net/bluetooth/l2cap.h | 10 ++-- net/bluetooth/6lowpan.c | 18 +----- net/bluetooth/l2cap_core.c | 78 ++++++++++++++++++++----- net/bluetooth/l2cap_sock.c | 103 ++++++++++++++++------------------ net/bluetooth/smp.c | 27 ++------- 5 files changed, 127 insertions(+), 109 deletions(-) -- 2.54.0