🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #197

Re: [PATCH net v3] net: fix NULL dereference in skb realloc fault injection devname filter

#197
From: Breno Leitao
Date: Wed, 07 Oct 2026 09:01
33 lines
7469 bytes
On Wed, Oct 07, 2026 at 08:41:58AM +0800, Haishuang Yan wrote:
> When a device name filter is set in
> /sys/kernel/debug/fail_skb_realloc/devname, should_fail_net_realloc_skb()
> compares it with skb->dev->name without checking skb->dev first.
> 
> skb_might_realloc() is called from pskb_may_pull(), pskb_trim() and
> pskb_trim_rcsum(), which also run on skbs that are not associated with
> a device. One example is a netlink broadcast to a listener with a socket
> filter attached, which goes through sk_filter_trim_cap(). With the
> filter set, such an skb makes the kernel oops:
> 
>   KASAN: null-ptr-deref in range [0x0000000000000118-0x000000000000011f]
>   pc : strncmp+0x50/0xf0
>   lr : skb_might_realloc+0x58/0xa0
>   Call trace:
>    strncmp+0x50/0xf0 (P)
>    skb_might_realloc+0x58/0xa0
>    sk_filter_trim_cap+0x6a0/0x928
>    do_one_broadcast+0x35c/0xb20
>    netlink_broadcast_filtered+0x1a4/0x328
>    netlink_sendmsg+0x724/0xa58
> 
> The fault is meant to be injected on network interfaces, so skip skbs
> that are not associated with a device. Without a device name filter,
> such skbs are no longer reallocated either.
> 
> Fixes: 12079a59ce52 ("net: Implement fault injection forcing skb reallocation")
> Suggested-by: Breno Leitao <leitao@debian.org>
> Assisted-by: LLM
> Signed-off-by: Haishuang Yan <yanhaishuang@cmss.chinamobile.com>

Reviewed-by: Breno Leitao <leitao@debian.org>
Technical Details
Message-ID: <asYKFJZY45h52BhY@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-342275-linux-kernel-netdev=dewy.ru
References: <20261007004158.1266795-1-yanhaishuang@cmss.chinamobile.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-342275-linux-kernel-netdev=dewy.ru
From: leitao@debian.org (Breno Leitao)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v3] net: fix NULL dereference in skb realloc fault
 injection devname filter
Date: Wed, 7 Oct 2026 02:01:51 -0700
Organization: Usenet Network
Message-ID: <asYKFJZY45h52BhY@gmail.com>
References: <20261007004158.1266795-1-yanhaishuang@cmss.chinamobile.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="658616"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:S18QTBVwJvzDqFjWspB2UkAiV6A= sha256:3b6TpytEL5mX+8Y7l56nWtkFZmbK94xBeHonoX7Ykd4=
	sha1:m/qdqRK8+ECBSalPCc5K/L1u1Qs= sha256:rxS6qHr92TMXpvXobsdL+FkhTK2ZHbLf7lx/q1oLARU=
Content-Disposition: inline
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 4A3EE10F17C; Wed,  7 Oct 2026 17:00:49 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.392
X-Spam-Status: No, score=-3.392 tagged_above=-9999 required=6.31
	tests=[DKIMWL_WL_HIGH=-0.241, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, 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=debian.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 pAF9yrtZlkqb;
	Wed,  7 Oct 2026 17:00:46 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-342275-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=debian.org
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 15FC410F141; Wed,  7 Oct 2026 17:00:44 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sto.lore.kernel.org (Postfix) with ESMTP id 72DE46081F2; Wed,  7 Oct 2026 09:05:24 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id E73AB48593C;
	Wed,  7 Oct 2026 09:02:26 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="TG+G3m7W"
X-Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108])
	(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 5A22147C0FE;
	Wed,  7 Oct 2026 09:01:58 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1791363746; cv=none; b=BC4Wm5RG53PReSvzzncIQzJECX6L52s0lvhsc0aUarOdTgIf+CDfBj3Ybsh5m21psAB/6ETkiGqrLJ5LzEYx4pyjKmkMSC8LL8mx5q8jvy+SLxL64pCCFRZ/Ruj6CsMCyWs1K7gc0vrB1mnVHeK001Sgy5+i8nk3dmcDr4PQsmw=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791363746; c=relaxed/simple;
	bh=AR2xGLZKIferTHOTi087PxlTZF+2KDb/LdX9Yw9EXqM=;
	h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To; b=HPsvbn36ys/PrfzO7RfUj2DNJUG+JrSzlj/r7v86SsKoOtpCZTkVTxF915WiLMWveTxbhr9WLCEMtiYTNaSidhg1g2NRRmV57kouJrlZCcOgeoWkIkw/n+01FfKJ9vZOJKSSVQGdCGoJuSwsgejtnSpZISMOupgXEIkKcXRKGdE=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=TG+G3m7W; arc=none smtp.client-ip=82.195.75.108
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org
X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org;
	s=smtpauto.stravinsky; h=X-Debian-User:In-Reply-To:Content-Type:MIME-Version:
	References:Message-ID:Subject:Cc:To:From:Date:Reply-To:
	Content-Transfer-Encoding:Content-ID:Content-Description;
	bh=ymnwsRZDmp7x5OjeUD7x2IVlrPaB2H4EiiL0/5QC8as=; b=TG+G3m7WrdlyZZOh1EA3pX+6kl
	/hhKs3ZnOWjK0sk3YBAOcLmKvon6yIzzJEa68uGcy9m0NCFGLjcM6cXeeoekgj+qjOiBe0GJ3r6vX
	y/Iavs2sBSlRUsj0I/idLLltQJkmcW9CD4W3t7cy9XcMtXZl3usJWh1RIlZaT4l8aK2w200uj1RaV
	C2xSvJj2l1w5SploRHOMJujYodETPYiD76hFb+V8p60hslvSZWASLjREAmFYvfWpluuQ6o2KKYZRa
	fq9hPuo8lS7ju7xWtBwIGTwsGjKg2uW1ScthCi2Az4vCnCXcUXVl3Pj8BZ/0xWDumHrW1IDH6PDKQ
	qp4TFPRA==;
X-Received: from authenticated-user
	by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
	(Exim 4.96)
	(envelope-from <leitao@debian.org>)
	id 1xENX9-004dOK-2S;
	Wed, 07 Oct 2026 09:01:55 +0000
X-Cc: netdev@vger.kernel.org, "David S . Miller" <davem@davemloft.net>, 
	Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, 
	Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>, 
	Guillaume Nault <gnault@redhat.com>, Akinobu Mita <akinobu.mita@gmail.com>, 
	linux-kernel@vger.kernel.org
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-In-Reply-To: <20261007004158.1266795-1-yanhaishuang@cmss.chinamobile.com>
X-Debian-User: leitao