Article View: linux.kernel.netdev
Article #1716Re: [PATCH net-next 10/37] can: skb: make echo skb freeing safe in any IRQ context
From: netdev-bot+sashiko
Date: Sat, 10 Oct 2026 14:02
Date: Sat, 10 Oct 2026 14:02
59 lines
7759 bytes
7759 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] Commit "can: skb: make echo skb freeing safe in any IRQ context"
fixes a bug that is real and long-standing, but its message has noโฆ
--
can: skb: make echo skb freeing safe in any IRQ context
This commit changes the kfree_skb() and consume_skb() calls in
can_put_echo_skb(), can_create_echo_skb(), can_dropped_invalid_skb() and
can_dev_dropped_skb() to dev_kfree_skb_any() and dev_consume_skb_any().
With this change, these paths are safe when the caller has hardware
interrupts disabled.
Link: https://patch.msgid.link/tencent_E84809CF236D0137885E7E4E4D58340B3208@qq.com
> can_put_echo_skb() can be called with hardware interrupts disabled. Its
> direct drop paths use kfree_skb(), while can_create_echo_skb() uses
> kfree_skb() when cloning fails and consume_skb() after a successful clone.
> None of these helpers is safe in every IRQ context.
[Severity: Low]
The code change looks fine, but should the commit message have a Fixes:
tag and Cc: stable?
The premise is correct. For example, janz-ican3 reaches
can_create_echo_skb() with hard IRQs disabled:
drivers/net/can/janz-ican3.c:ican3_xmit()
spin_lock_irqsave(&mod->lock, flags);
...
ican3_put_echo_skb(mod, skb);
can_create_echo_skb(skb);
consume_skb(skb); /* or kfree_skb() if skb_clone() fails */
Before this patch, that consume_skb() ran the skb destructor (normally
sock_wfree()) from skb_release_head_state() with IRQs off.
dev_consume_skb_any() and dev_kfree_skb_any() exist to avoid exactly that.
The old code is also in stable trees. Could the message name an affected
caller such as ican3_xmit(), and the commit that introduced the problem?
The companion patch in this series, "can: skb: make CAN skb allocation
failure paths IRQ-safe", does have a Fixes: tag.
> [mkl: also convert can_dropped_invalid_skb(), can_dev_dropped_skb()]
Could the message also say which IRQ-disabled context reaches
can_dropped_invalid_skb() and can_dev_dropped_skb()? Right now the reason
for converting these two helpers isn't given.
--
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261009134323.64064-2-mkl%40pengutronix.de
Technical Details
Message-ID:
<179164097179.434549.93216443064751210@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-344223-linux-kernel-netdev=dewy.ruReferences:
<20261009134323.64064-11-mkl@pengutronix.de>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-344223-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next 10/37] can: skb: make echo skb freeing safe in any IRQ context Date: Sat, 10 Oct 2026 14:02:51 +0000 Organization: Usenet Network Message-ID: <179164097179.434549.93216443064751210@kernel.org> References: <20261009134323.64064-11-mkl@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1345290"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:yf9LK17gyQmL6ohKOa1BLPj4uAE= sha256:u9KcuHnfc6CSdGso5JEaDcc8btvDTOKfiNgNyKcEHkk= sha1:zTFhy0zjcqYktD67kKT3r6Z/YYc= sha256:CMz/Ez5Sh208Q1dw0klMP28UposX5oY6ry0QCdu8Xlk= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 2E28210F8F9; Sat, 10 Oct 2026 17:04:44 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -1.341 X-Spam-Status: No, score=-1.341 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.241, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id m4kl3cWv_uD1; Sat, 10 Oct 2026 17:04:40 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-344223-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 4DD7410F8F6; Sat, 10 Oct 2026 17:04:37 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sea.lore.kernel.org (Postfix) with ESMTP id 5835037AD4; Sat, 10 Oct 2026 14:02:54 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 275AC40F753; Sat, 10 Oct 2026 14:02:54 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="K4VTqWJb" X-Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 1360E381AF4; Sat, 10 Oct 2026 14:02:52 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791640974; cv=none; b=sOT5UPP+aANEyrfgel8bTd7LhHv/ekWddYyhA0eZkDJXy5SdV/kggMMoKF82YaTDEReermMOqqw+ktMAQr8wdBkxk1K5i2vrkw/RESKyyqfyzwzypWftZIRV92mLzlxT+2lZHqhDgWj798PQ2ca4+xE/lzeP2WYaln8EhSMDolQ= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791640974; c=relaxed/simple; bh=hsVeYh3gb5HrH0c+Vo644V4VaqnCUpwUMbLNtHO5smI=; h=Subject:From:To:Cc:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=SwQKft6bHn7ta7s3pwhwe7NJnQoPSZG+u3HGVFAkd54AhB9ZB3ACSiMoO7FdwIlOvpQdtqn0UMzqYmXjXWAjLVgvbLnpcBWkIuGVRZm8qVOJFfh79QYz31ZySd1S3EAYDsW+c+b6qx9X5aGeBxwwrxMAt5JRcPvtKmuxpI9jTJ4= X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=K4VTqWJb; arc=none smtp.client-ip=100.103.45.18 X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 427CB1F00898; Sat, 10 Oct 2026 14:02:52 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1791640972; bh=NJdA1akvPw3elh6MPd7UUehuKt2sZx7s57pv+zDWAfM=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=K4VTqWJb/rObiqRENU4fIaPoILerj30oYEmSEIJKgGL8dGd5BORp33y2LZDk7DZ7w eXO6pVT2pG5qOGtGMGadpCxphfTFZXT/jQ+X775DCPTERXuXKuP6CtzT6oJlaNwc0y ni81TwM9GHqhDssrN0V1NwCt7h0oLZyZgNfJ6mYuQmAyrhb56To8gwBNjfujd8KXXd s2iJudBSXIpT3reBSz/iVvSqKULNTTSyPzL83t6B3AzgU4Y2JkP/JmmB6wHb6zaKMM F6oChwCgSalBkggkcgFZNA6EYvrXwMmU2C1IqpdjrWOx5s9r6Whm2QyGm2m1/JMPg1 dBo1fcMG3bA0g== X-Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org, linux-can@vger.kernel.org, kernel@pengutronix.de, hemanth.selam@gmail.com X-In-Reply-To: <20261009134323.64064-11-mkl@pengutronix.de> X-sashiko-severity: Low X-Precedence: bulk X-Mailing-List: netdev@vger.kernel.org X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>