Article View: linux.kernel.netdev
Article #214Re: [PATCH net-next 0/9] net: skbuff: convert most BUG_ON()s to WARN_ON_ONCE() and an error
From: Fernando Fernandez Mancera
Date: Wed, 07 Oct 2026 14:59
Date: Wed, 07 Oct 2026 14:59
29 lines
10841 bytes
10841 bytes
On 10/7/26 4:48 PM, Willem de Bruijn wrote:
> Josef Bacik wrote:
>> I'm going through and reducing BUG_ON() usage in areas that have created
>> the most problems for us. 89 commits in the tree quote "kernel BUG at
>> net/core/skbuff.c", 31 of them since 2024, and some of those could be
>> triggered from inside a user namespace.
>>
>> The first patch is a fix: skb_copy_and_csum_bits() leaves stale bytes
>> in a buffer headed for the wire when it hits unreadable frags. The
>> BUG_ON() conversion of the same function needs the same handling, so
>> it's here rather than sent separately.
>>
>> The rest of the series converts 17 of the 19 BUG_ON()s in skbuff.c.
>> Each one becomes
>>
>> if (WARN_ON_ONCE(cond))
>> <error path>;
>
> Good idea. I was thinking of doing exactly this sweep after addressing
> one case recently in commit ee1972def665 ("net: downgrade BUG_ON
> EIOCBQUEUED in sock_sendmsg_nosec")
>
> Instead of WARN_ON_ONCE, which still triggers a panic on systems with
> panic_on_warn, DEBUG_NET_WARN_ON_ONCE?
I agree with using DEBUG_NET_WARN_ON_ONCE at least for paths that can be
triggered from userspace. I did something similar in Netfilter subsystem
not so long ago.
Technical Details
Message-ID:
<41e10839-ec8d-4509-a6b2-45e009b9232c@suse.de>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342383-linux-kernel-netdev=dewy.ruReferences:
<20261006-b4-skbuff-bug-on-v1-0-1b4434c5357c@toxicpanda.com> <willemdebruijn.kernel.140f4eac91ab3@gmail.com>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-342383-linux-kernel-netdev=dewy.ru From: fmancera@suse.de (Fernando Fernandez Mancera) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next 0/9] net: skbuff: convert most BUG_ON()s to WARN_ON_ONCE() and an error Date: Wed, 7 Oct 2026 16:59:09 +0200 Organization: Usenet Network Message-ID: <41e10839-ec8d-4509-a6b2-45e009b9232c@suse.de> References: <20261006-b4-skbuff-bug-on-v1-0-1b4434c5357c@toxicpanda.com> <willemdebruijn.kernel.140f4eac91ab3@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="670099"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:Xp1Q+xQYcDPhtL8Q0V3lBl3JBQQ= sha256:tPAHq7e5jlvhuweTmG7NLzQBusUe2KaXm2Xd7nCCFpY= sha1:9RjgsZKTG+REEIbzBW1DFMkK1XQ= sha256:vukIDGLaE6cmu1VcpBqZTIpCFmA3XLUS3Uw8uKRGn3E= Content-Language: en-US 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 9F2D910F19B; Wed, 7 Oct 2026 18:05:32 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -0.75 X-Spam-Status: No, score=-0.75 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=suse.de header.b=cIU6WXoY; dkim=neutral reason="invalid (unsupported algorithm ed25519-sha256)" header.d=suse.de header.b=2/1+t7zz; dkim=pass (1024-bit key) header.d=suse.de header.b=cIU6WXoY; dkim=neutral reason="invalid (unsupported algorithm ed25519-sha256)" header.d=suse.de header.b=2/1+t7zz 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 lmMd2-T84OVa; Wed, 7 Oct 2026 18:05:25 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-342383-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=suse.de X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 88C8F10F17E; Wed, 7 Oct 2026 18:05:17 +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 3BC1B2D4EC; Wed, 7 Oct 2026 15:00:26 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F2C5A2F8E9E; Wed, 7 Oct 2026 15:00:25 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="cIU6WXoY"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="2/1+t7zz"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="cIU6WXoY"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="2/1+t7zz" X-Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 C1C174BB29A for <netdev@vger.kernel.org>; Wed, 7 Oct 2026 15:00:19 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791385225; cv=none; b=Efgd9zW85hfDHjNQa8pDHf1V/HwR/Wmwh+QZEvweOm7cUG74K5pgbZJNSFp1iDpqv46gON92JsUvlzwOSQABSKXGAXzr6XI/+olyxtxPhs4mK3Guz/wK6VktRe4amdKzbHv99pojDnsW6Ufwx7LtAKC6Akag8a0Yc7ZBLatUdao= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791385225; c=relaxed/simple; bh=G76zBPF5TjpzhHP008Ppuq7rGi4Oh3NJr3mZdHZ6BbI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=GUd9+pgeQ5hfgSPyikpPivT4T8HihuoMnWk8oQpRBRNlKooFntMK7OvyuQIOw7qS2mVi3/+O4+vU0+NA/5ElkCqfhv+GSTx/chAH7sGYc+lg20JSzimho9zzYmsrdg2bQVVD1x9MDKlRvwFm0y8uYgAXjxUMIgUsBksi4L4P/Ec= X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=cIU6WXoY; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=2/1+t7zz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=cIU6WXoY; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=2/1+t7zz; arc=none smtp.client-ip=195.135.223.131 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de X-Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3028E1F38E; Wed, 7 Oct 2026 15:00:05 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1791385205; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w80dgYPSS45qRc1JEm1pGFFYGt+E5Kke5+EAa6khtW0=; b=cIU6WXoY6rhLxnTSY+62ldSCqQfK/qCQCAYuE5UAVbdUCqLMmj9jBrqI355ze5SScKu5i4 PZVKkLfP05prp9s4nDEGoWW8AZIcihTiXfgJjptG5VZQaAfcl1/u4Tp4+9j0iAen+Ogvbu WMG5KVRBsMvftUahmaEV89FUpxUQoMc= X-DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1791385205; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w80dgYPSS45qRc1JEm1pGFFYGt+E5Kke5+EAa6khtW0=; b=2/1+t7zzBDES/TXMw2j1UCi1Ywva5bUQGV7GaVNo7J2dgtwdskRod6Y69KEkXPjxJ41meq kPfmnHSxT4PVtMDQ== X-Authentication-Results: smtp-out2.suse.de; none X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1791385205; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w80dgYPSS45qRc1JEm1pGFFYGt+E5Kke5+EAa6khtW0=; b=cIU6WXoY6rhLxnTSY+62ldSCqQfK/qCQCAYuE5UAVbdUCqLMmj9jBrqI355ze5SScKu5i4 PZVKkLfP05prp9s4nDEGoWW8AZIcihTiXfgJjptG5VZQaAfcl1/u4Tp4+9j0iAen+Ogvbu WMG5KVRBsMvftUahmaEV89FUpxUQoMc= X-DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1791385205; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w80dgYPSS45qRc1JEm1pGFFYGt+E5Kke5+EAa6khtW0=; b=2/1+t7zzBDES/TXMw2j1UCi1Ywva5bUQGV7GaVNo7J2dgtwdskRod6Y69KEkXPjxJ41meq kPfmnHSxT4PVtMDQ== X-Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 6231F13354; Wed, 7 Oct 2026 15:00:04 +0000 (UTC) X-Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id RQ8RD3RexmplbwAAD6G6ig (envelope-from <fmancera@suse.de>); Wed, 07 Oct 2026 15:00:04 +0000 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> X-User-Agent: Mozilla Thunderbird X-Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org X-In-Reply-To: <willemdebruijn.kernel.140f4eac91ab3@gmail.com> X-Spamd-Result: default: False [-2.79 / 50.00]; BAYES_HAM(-3.00)[100.00%]; SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-0.996]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; TAGGED_RCPT(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_TWELVE(0.00)[13]; FREEMAIL_TO(0.00)[gmail.com,toxicpanda.com,davemloft.net,kernel.org,redhat.com,google.com]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo]