From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 AC7B33AE6E5; Mon, 10 Aug 2026 12:36:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786365412; cv=none; b=I/sCgj1Wl8udOJAP92e1X5PcHnUfgWR0S7FS88xclb2wV/YmOjjL/FplghLPyUbyDGAfFeEEo2HS7LYOYAUeJos/nXg0x5xI/ZL0Q+OUQXtLXsuEyEnahnRF25IbM/0BWLD7FTDNdebjGKqmBZI4Qmbz/kFJWgvKA4Dw7iYj8a8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786365412; c=relaxed/simple; bh=j4F3tgNrpv0XFiriZBcZk2urtDkPZeiy2AJEH+WvzM4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=AaMfrPg9QSKMG78SGMjVAyrbRuM/42S5H6gZPbqFE4/ybepRgExjMZO/jEakujvu4qF8kPC73RqDwwqn0xHFNwYP4oZPHf0NH61Vrc6q14KvVA1NgFKN+WCTmR1HImfPDbN8gfre+UOyBkQfMeBrQLSJ3b/42Fq8ZWFoXDbBr/M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=u55cUtK+; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="u55cUtK+" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id B4ADA4E41178; Mon, 10 Aug 2026 12:36:46 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 8072D6033B; Mon, 10 Aug 2026 12:36:46 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id C041311C4A500; Mon, 10 Aug 2026 14:36:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1786365401; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=f7VR1hd95VoqCyFMdN0c7NIB9QevljWPF/Tlu8MmGBY=; b=u55cUtK+OUd9hipscxjuaRgMXOqYdx258FCgQ8IbMheYj77mC0GegPbs1MyijjdMcdCb7U e/utZFaQHj72F364cjtCbbyNPUo2chh1fwu5FGC6siUKW03oI2uifaiBirXRJS9M4IvrZW VhM7VPeFxgtmRO4VQOdyGmQbLxekGu4xYSiUbVDrRwfLt7hvkdoDqzIZ5C1FzD0Up2hdwh 0Zue4LKRvqwWsLPSjXEeVUno5spIpKNakLPiEBTHlxVCrlmwjVKFMw2u7GtFif0GeKuKDo riZtmJSKW2QJhG84Q5Z21q4VM/0p1yQEUjmeixj2esoCCJm2n9Hw7NuUNvCU8A== From: Miquel Raynal To: Fan Wu Cc: linux-wpan@vger.kernel.org, Stefan Schmidt , Alexander Aring , Varka Bhadram , Andrew Lunn , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v2] ieee802154: cc2520: fix FIFOP work use-after-free In-Reply-To: <20260809021917.102947-1-fanwu01@zju.edu.cn> (Fan Wu's message of "Sun, 9 Aug 2026 02:19:17 +0000") References: <20260809021917.102947-1-fanwu01@zju.edu.cn> User-Agent: mu4e 1.12.12; emacs 30.2 Date: Mon, 10 Aug 2026 14:36:31 +0200 Message-ID: <871pc6rw34.fsf@bootlin.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Hi, On 09/08/2026 at 02:19:17 GMT, Fan Wu wrote: > The FIFOP interrupt handler queues cc2520_fifop_irqwork. On removal, > cc2520_remove() only flushes the work. The devm-managed FIFOP IRQ > remains active until after ->remove() returns and can queue the work > again after that flush, allowing it to run after the private data is > released. > > Disable the work with disable_work_sync() instead of flushing it, so > the handler can no longer queue it once removal begins. Destroy > buffer_mutex last, since unregistering can invoke the driver's stop > callback, which uses it. > > Install the SFD IRQ before cc2520_register(), so it is available when > the netdev becomes visible. Install the FIFOP IRQ afterwards, so a > registration failure cannot schedule RX work while its hardware is > being released; cc2520_register() no longer frees the hardware on its > own failure, leaving that to the probe cleanup. This is a cleanup mixed with a fix. These must be two different patches, because I don't think you need the cleanup for the fix to make sense. Thanks, Miqu=C3=A8l