Article View: linux.kernel.netdev
Article #6452Re: [PATCH net v6 1/1] ipmr: only copy pktinfo to cache reports
From: Eric Dumazet
Date: Thu, 22 Oct 2026 14:02
Date: Thu, 22 Oct 2026 14:02
34 lines
9418 bytes
9418 bytes
On 10/20/26 08:39, Zhiling Zou wrote:
> ipmr_cache_report() prepares IP_PKTINFO on the original skb. The
> ipv4_pktinfo_prepare() helper updates skb->cb and clears the pktinfo fields
> when packet info is disabled. Since the skb can continue through the data
> path, preserve and restore its original control block around the helper.
>
> The original implementation copies the entire control block to the report
> skb. For synthetic RTM_GETROUTE packets, NETLINK_CB data is interpreted as
> IPCB by the raw IPv4 receive path. With IP_RECVOPTS or IP_RETOPTS enabled,
> corrupted option offsets cause out-of-bounds reads or a stack buffer
> overflow. WHOLEPKT and WRVIFWHOLE reports also inherit stale IP option
> offsets when their header is prepended.
>
> Clear the report skb control block. Only prepare and copy pktinfo when the
> input skb has an IPv4 header. Synthetic route-query skbs use NETLINK_CB,
> not IPCB, so leave their report control block zeroed. Restore pkt->cb after
> preparing pktinfo for regular IPv4 packets.
>
> Fixes: bb7403655b3c ("ipmr: support IP_PKTINFO on cache report IGMP msg")
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Cc: stable@vger.kernel.org
> Reported-by: Vega <vega@nebusec.ai>
> Link: https://lore.kernel.org/netdev/20260903113055.GA90787@shredder/
> Suggested-by: Ido Schimmel <idosch@nvidia.com>
> Suggested-by: Eric Dumazet <edumazet@google.com>
> Assisted-by: LLM
> Signed-off-by: Zhiling Zou <zhilinz@nebusec.ai>
I have not seen this message, because my email is edumazet@kernel.org
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Technical Details
Message-ID:
<885073f4-f0a7-4aa7-8ee9-e8c04d04f2fa@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-350598-linux-kernel-netdev=dewy.ruReferences:
<cover.1792476357.git.zhilinz@nebusec.ai> <0545f0c83f5ee2f6696210f87268e811ef655715.1792476357.git.zhilinz@nebusec.ai>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-350598-linux-kernel-netdev=dewy.ru From: edumazet@kernel.org (Eric Dumazet) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v6 1/1] ipmr: only copy pktinfo to cache reports Date: Thu, 22 Oct 2026 16:02:51 +0200 Organization: Usenet Network Message-ID: <885073f4-f0a7-4aa7-8ee9-e8c04d04f2fa@kernel.org> References: <cover.1792476357.git.zhilinz@nebusec.ai> <0545f0c83f5ee2f6696210f87268e811ef655715.1792476357.git.zhilinz@nebusec.ai> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="224590"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:5xmJ5LCLp4bIP356r8x74RUSQ4U= sha256:045wcDPjSKF0DXoHYyaYq5ga7AC/OzlbHSMsmD15Drw= sha1:FqiZJUrTIi7ubzrDgHcks1EfNSo= sha256:cTCrRddgWNzsPok4bgjeFD0tvM76g+h0d7YBuFurzm8= 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 54DA711129C; Thu, 22 Oct 2026 17:09:53 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.739 X-Spam-Status: No, score=-3.739 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.339, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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=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 cMRK-lOMBjK0; Thu, 22 Oct 2026 17:09:45 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-350598-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 sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id C4A11111287; Thu, 22 Oct 2026 17:09:36 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id CFAD62AD01; Thu, 22 Oct 2026 14:02:58 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1792677777; b=i7WI5bqe0Mb+ZnvSvlf2PCOE0t3F03tkx4IByIUdLvlkK8O83Ss5YnI6FICFlQGjEIgW zSwv56w7YYXjGLAgq9FZ30EsfanE+Qhc3cZ0k0uWczdOp+TBd/I//eRYdZLPjurN0+3rh vgeZaCXWmeXfFsM4amW8/o825PLskTvSlduvWltCCa9zau7Haz5WbuKLrdESvqa+Q/vWm Mbb+d8JX0f4B6X1i0/lLyy9lB1MuRdmg4/79ak64mzUe5LbsIKUItTOrNdvy9DGalGNK7 pFkz9a3lX8sFNKpqKBWZRbFMqUSPT+Wg8vKaXnpkXuAYPmE2P7wyhIRi0e5o8mAi1Cg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792677777; h=X-Original-To:Received:Received:DKIM-Signature:Message-ID:Date: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=MMvIVX1W7YbUBzv1Vsn7O+zoox8rhwsLu4nv9vQWM4I=; b=pMT5bQduZYA22mou2cor4yslnxzEqi//FyWLEZIt91RmjKNRFQh3fEFFRTRp0qkl+z5P SVRbZ9D0for218cOt1zNS2lfvxoZp6QzkWOQN97+UUUJ9+kjFFoxEq3Iq6TpsoAuRa9dg m2bKwLDgbqvWLaJXnqk0tBfUpZ6I6H7Z5veJN6FgwosCrfeTZysSNO/tIYHa/88qb5fju wAZwKI01Gx7v2k1CGT055P+z5vy45wXOxA5r6O/+a81V6OhxpdgYlHflo0KQE/227wuqo Lxi4KaSDeUFzeXiJQyRM1Uc064zKH4XxTb9S7mbeA2P56u8bweFdIqWL43YVBGG11VA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=MquOjWda; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3D64E606A31F; Thu, 22 Oct 2026 14:02:57 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=MquOjWda X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792677776; b=ZBHayNv1zVwS3BZECRngk/FKaHdWTpteCRD9Yo5WRrnFa/msmx3mdnfPPI5ycfRpEvlI 4mTENR1pUeekfWZ9O5t7bdV82dZZk6WO2zYCNArLXBr831dsN3ZbWVeC4LXCjx9CoKBEp XNy5/uYcyMKqMQJV1HFyWFKK20wHg5kDdHxA8BfSfsnhJyv/iTQ2EO9Y88FsSwgIH691I z6NCFRLB0tYf180N+xiAFNiKpNdDqm6v3BdgAMklaEAEnR+03/tisc/dx3ZUg+H9H17uC 0nTsUjq/smWnYykN8fnGvbRlKFEH2XE/DU7h/Um1SfYd4lXrtQ41n6BTcvtuPgITa2A== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792677776; h=Received:DKIM-Signature:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=MMvIVX1W7YbUBzv1Vsn7O+zoox8rhwsLu4nv9vQWM4I=; b=n1p/+AqH76N3EDg3b3ymvjwX53KEMdR49X2L99TYlFTybtNHao9+Ncd2Gk0puBoB4j1R T/ZY3sXeU49npmNOB60eIGRSuzGhP+LUQf3ryLbGJq6FzV6K7IOI1+lTIHPtdo09IsdJU +urSI6BARsR4i030co/177BTXw9uuD3rtdm0JapxPShZiRlmrdNLvdthQSiFyQyN8kptN o9viKa0QmdiTOMxX6OhvA6RdLtUCUOVsZKwuXuM20IE/WqGGBQ/wCWJvttKYES6YO5h6o LTSXDtKnx55qUoJK6sDC7Ug7KrTAHDBGn5u5At42gbwuYqakMwQyhYpcfqrbjxTncMA== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=MquOjWda; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21F00606A321 for <netdev@vger.kernel.org>; Thu, 22 Oct 2026 14:02:56 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id D82261F000C4; Thu, 22 Oct 2026 14:02:53 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792677776; bh=MMvIVX1W7YbUBzv1Vsn7O+zoox8rhwsLu4nv9vQWM4I=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=MquOjWdalYsZU9tyRxRgIgOsQMzS/0FEu/NiH5zCy9iwj+XR7UW1mSft2dKzIiXZp QDkw19+3m3x8ztErU5qHWiGwp8IUv2ne+3G7GZ9daPa7yyPYhztgy7fJWHJKnKakJl +y2CqrGP6ktdAwmn17NP9L3m06U8v1TckQ2gU4IIwNPK5QlYRkxT57wyQlEbb47kdQ ixnhGboXJapEJjbms81ajnR0szzgAFhHjirE/5u6rmzEK0ZbUmdfLH4iT3FFws/hux PYqRn3thKW2UEwz9hBlWqPWAa/XSio8++3dfJ3Xq5GNN/1Zqi6B4R7wNEOsZq16G5f iKocTiyo4MGFA== X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-User-Agent: Mozilla Thunderbird X-Cc: dsahern@kernel.org, davem@davemloft.net, pabeni@redhat.com, horms@kernel.org, leone4fernando@gmail.com, vega@nebusec.ai X-In-Reply-To: <0545f0c83f5ee2f6696210f87268e811ef655715.1792476357.git.zhilinz@nebusec.ai>