🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #212

Re: [PATCH net-next 0/9] net: skbuff: convert most BUG_ON()s to WARN_ON_ONCE() and an error

#212
From: Willem de Bruijn
Date: Wed, 07 Oct 2026 14:48
24 lines
9047 bytes
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?
Technical Details
Message-ID: <willemdebruijn.kernel.140f4eac91ab3@gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342380-linux-kernel-netdev=dewy.ru
References: <20261006-b4-skbuff-bug-on-v1-0-1b4434c5357c@toxicpanda.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-342380-linux-kernel-netdev=dewy.ru
From: willemdebruijn.kernel@gmail.com (Willem de Bruijn)
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, 07 Oct 2026 10:48:47 -0400
Organization: Usenet Network
Message-ID: <willemdebruijn.kernel.140f4eac91ab3@gmail.com>
References: <20261006-b4-skbuff-bug-on-v1-0-1b4434c5357c@toxicpanda.com>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="668593"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:O2K6ZxTI5JSFMTUFZ1wpV5UDsjk= sha256:MeMhCWNPbk+9n6326gx4PqZQTK64RU6Ws+M4PHLwmoI=
	sha1:R5ajkiUOj3TGUkGE93Q1enHzz/Y= sha256:WM5JbLCjiQ0cHGcQvSSTvgRtkK+tc5i6s3bF7O9tdpc=
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 4983810F199; Wed,  7 Oct 2026 17:57:02 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 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, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, 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=gmail.com
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 zGXqA1u4HfcG;
	Wed,  7 Oct 2026 17:56:59 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-342380-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 66C5210F18F; Wed,  7 Oct 2026 17:56:56 +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 C4D7B35C6D; Wed,  7 Oct 2026 14:48:55 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 686364AD4AA;
	Wed,  7 Oct 2026 14:48:54 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iBh1OzzV"
X-Received: from mail-yw1-f176.google.com (mail-yw1-f176.google.com [209.85.128.176])
	(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 D28FD3B38A1
	for <netdev@vger.kernel.org>; Wed,  7 Oct 2026 14:48:49 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.176
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791384534; cv=none; b=B5L9H7n3KnJ4o8JOi79TDRUP2vZRkuD6KpW6xfAbLlrmFp+dPBKTKiF8jJgs55DgZlyFVChbMwMrsKfBw6ztZ0XHDjVyokgn1iOFOHMpePDS/s9BC4Rt0TYpqOleGlCzz6thkL9touqtQ07wVfcNkOGTWnpovLOfaLSXdY7qtyU=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791384534; c=relaxed/simple;
	bh=7Y2j2y6ajaG/zDk1wERigWBnYImYN4e7RWhBT0nBLk0=;
	h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject:
	 MIME-Version:Content-Type; b=JmMbz80nAGwW9/3fvK6JkhsLgBkN0qJp21XY7DmnHPlOlfPjujoeB+VeUnowMbirNZWD3uxXvprGDYAfXOySs/4qUDTP6xGvD3MrBoIi05XcFsKO/Dz+JQnXckGGRNF7+zE6wkU7pRHgdKOlV7m8K/BL5ZwTgjPrA0XhEtP6m5M=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=iBh1OzzV; arc=none smtp.client-ip=209.85.128.176
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-yw1-f176.google.com with SMTP id 00721157ae682-8ab3d3c5761so19914847b3.1
        for <netdev@vger.kernel.org>; Wed, 07 Oct 2026 07:48:49 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1791384529; x=1791989329; darn=vger.kernel.org;
        h=content-transfer-encoding:content-type:mime-version:subject
         :references:in-reply-to:message-id:cc:to:from:date:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=dfiB9VnO/q2CSY+pSu0B7BRn9rM8krRdw97n0xu/4ys=;
        b=iBh1OzzVt5rLZycOZGB+FE/Dx7KJ94fIf5Tln25acSfTQME3YfWMkMU62E6sKlVtg2
         GFzOTKFOECNZit0yflIkuVmPXI0twmZ3QVT78uj1L1UKiZrUiAO615JR42NZOVOCtOTi
         OmUMw4ddDMT3i/yomQAGbVrn9SyIUZaTSzjtOVzbAC7hanKHhf3fS0WmivGKRK+2y7Vb
         Xz9O3G62LOmHc+XTte+l0S5FXF/PzxW2O/OvE/Cwlt8xlwEyFBzBRNbowoF6IZwS+w51
         4U94T3pFA1sDXagXwi8coKdE2omF3Oyl4ak8VmA0G7pe65K98ARH/VCUv0TW7i8GCRLx
         plDg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1791384529; x=1791989329;
        h=content-transfer-encoding:content-type:mime-version:subject
         :references:in-reply-to:message-id:cc:to:from:date:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=dfiB9VnO/q2CSY+pSu0B7BRn9rM8krRdw97n0xu/4ys=;
        b=HimoQmsRDD7fwu+zDkukFd9T1XGgWtMzRN4Tp5przw8H59VjH3jNmQHGvBzazbXyp0
         xvV7HuMCavSYZ2MrsTSi/PLFZDK/U52q6flX4elDLkDiSDgPc6UaGctsTdvB1Vzm+IVc
         guMOw/1gVnNmOGvuXDfhbOs48JUb39ybD7GcyrjMFkyXyip0cWrXqnZp2cooB4xRKcxV
         HDPy6WbSWkFu/i8J4YR03rmnYmK2OPn1iGK8wQneTw/SjaV5MfNx0FRKjwAta55MBkHd
         ysbeAK6qX2uByp/kX6y/pCmscyI1MQH/vDrTAebe73Yu+WsvF9LUWVRW573IAxX1MeUe
         1kXQ==
X-Gm-Message-State: AFq9FYJ+ZoDiIT7ZZWZya9xccCUal01M+Qgprl2O0vAUnE9jh+eQhOTc
	8rRcAH31cdjJS2+s/oyiTe7q4IaL/6E7bYKUqWzbD7kkiAh82KUzOb7o
X-Gm-Gg: AYBFou1tw1Gz4VsMf+1h9v8ZBjz0U/azEoTlQekg0y9KOYhFztjwdBjdu4jj641UtYY
	JCsGXdAVvKOXqyJg/o/ksnGHqO7khvtp4Z8Ji3QlcS8St4s2ohCS97SSrInMLxk5/K6P/Y4mBn6
	KbfGHnyz6bfp1NlVBerWKuGmXUsFFOYKProrASocjzE0VGsi1bgx3Baj6aNRbfcoi8vMXik0w89
	aDZID85PM5twfjny6evm5is8cspMiRLE/8eE3YFSuBRFIZVPusf7FNlWCuxRL1F1xgLWY8ccoL5
	+3Fmo4QGQ0Ccijt3WIN2pjVCO4iW7Htnxe5E8E3YDW5mHoYxKantm2UDP1zwmC9wN3rLfPTiRNi
	wFXh0NO3U1o8YRiHI3C0ELBnMo5UfFEs5JDKTqpR6nraOiAlnhFqbU3Fd4OsJmmpbfxuyaKLunG
	iqcrM5kIPtPW/T8y6O3NdaLEHcGIrSXSlTB1eCh40Hqe+hSxIwSN+buPjmN8W2yEC74rjtNghAs
	9DDaZZzOLEdh9EPgYQgUZXF3lDBpCuFrwmKgVC9lcdOoYn+4PTc2sssXlikxIblheuoCblvUzAz
	Th7fGuGNudyJy12bBQT5sjNAEdrxJjg6e5oRKQ==
X-Received: by 2002:a05:690c:ec6:b0:861:a2ae:8c6b with SMTP id 00721157ae682-8b05ac458e3mr23348817b3.2.1791384528499;
        Wed, 07 Oct 2026 07:48:48 -0700 (PDT)
X-Received: from gmail.com (111.46.245.35.bc.googleusercontent.com. [35.245.46.111])
        by smtp.gmail.com with ESMTPSA id 00721157ae682-8b05abda9ffsm9529857b3.39.2026.10.07.07.48.47
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Wed, 07 Oct 2026 07:48:47 -0700 (PDT)
X-Cc: netdev@vger.kernel.org, 
 linux-kernel@vger.kernel.org, 
 bpf@vger.kernel.org, 
 Josef Bacik <josef@toxicpanda.com>
X-In-Reply-To: <20261006-b4-skbuff-bug-on-v1-0-1b4434c5357c@toxicpanda.com>
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>