Article View: linux.kernel.netdev
Article #3107Re: [PATCH ipsec v2] xfrm: zero-initialise km_event in the replay-notify path
From: Steffen Klassert
Date: Wed, 14 Oct 2026 07:38
Date: Wed, 14 Oct 2026 07:38
26 lines
7941 bytes
7941 bytes
On Wed, Oct 07, 2026 at 01:28:07PM +0530, Shubham Antil wrote:
> xfrm_replay_notify(), xfrm_replay_notify_bmp() and
> xfrm_replay_notify_esn() declare a struct km_event on the stack and
> initialise only its .event and .data.aevent fields, leaving .seq and
> .portid uninitialised. build_aevent() then builds the XFRM_MSG_NEWAE
> message with those fields:
>
> nlmsg_put(skb, c->portid, c->seq, ...)
>
> so the netlink header of a replay event carries uninitialised stack
> values rather than defined ones. This was confirmed at runtime rather
> than by inspection alone: the .seq and .portid carried in that header
> hold values that nothing in the replay path assigns.
>
> The request-driven paths set these header fields from the requester
> (xfrm_get_ae() / xfrm_new_ae()); only the kernel-originated replay path
> leaves them unset. Zero-initialise the event so the header fields are 0,
> the correct value for a kernel-originated notification.
>
> Fixes: f8cd54884e67 ("[IPSEC]: Sync series - core changes")
> Reported-by: Giovanni Vignone <gio@octane.security>
> Assisted-by: Claude:claude-opus-4-8
> Signed-off-by: Shubham Antil <shubham@octane.security>
Patch applied, thanks a lot!
Technical Details
Message-ID:
<as8xZWxejylzr4lx@secunet.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-346081-linux-kernel-netdev=dewy.ruReferences:
<20261007075807.70009-1-shubham@octane.security>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-346081-linux-kernel-netdev=dewy.ru From: steffen.klassert@secunet.com (Steffen Klassert) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH ipsec v2] xfrm: zero-initialise km_event in the replay-notify path Date: Wed, 14 Oct 2026 09:38:13 +0200 Organization: Usenet Network Message-ID: <as8xZWxejylzr4lx@secunet.com> References: <20261007075807.70009-1-shubham@octane.security> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Injection-Info: usenet.network; logging-data="2243603"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:UagD78mdOEsbtedNQVrIhbNbozs= sha256:FTRvUaGXD010qPrmh4h7pbmVUfW176eiYo3+ZriH2xo= sha1:dwiwkpUEt4GNvQ4c4t88S0tUuSA= sha256:2TPv8BaBtszC5XVoYGrNdw4t5Bty7lEyFt8y5/pLDis= 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 17BDA110065; Wed, 14 Oct 2026 10:44:55 +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.25, 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=secunet.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 6Lb2p_fBFXHP; Wed, 14 Oct 2026 10:44:51 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-346081-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=secunet.com X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id DE722110046; Wed, 14 Oct 2026 10:44:42 +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 74236301C0; Wed, 14 Oct 2026 07:38:28 +0000 (UTC) X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0F1453EC699; Wed, 14 Oct 2026 07:38:28 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=secunet.com header.i=@secunet.com header.b="MpXUWcIW" X-Received: from mx1.secunet.com (mx1.secunet.com [62.96.220.36]) (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 D05723002AB; Wed, 14 Oct 2026 07:38:24 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.96.220.36 X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791963508; cv=none; b=utjU2a1bUc6jtj5ieV8D9GFvttbGkMx+PWVL2P4X56i8eJ2TLAehInP04FRpzgylr/b8EmbfMbKF5ati7p5J2w24jHoMcZDpwOXcxeIkXPi7qRI5W6pdchR7FotqwyvE8trcR8gqu8W5F+x/IMl4zHFsVVF4ho4GfAzhevi6PqM= X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791963508; c=relaxed/simple; bh=vj1fm0p62yUErMUNpojScfEgVw4chzyYOjGeEZckTTE=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oyFjWt4GOmpZ9QtM7Ov/EWJowZ5urpkPMBDbTvzvIwGX/nDewN0qkbEfK0qwBtzmchmLJBTP43YWF6lRL0FrI/kTRMl0vQ3uvUROSgm+S7LGfPBSXmpVHIMTw+RjZvp0qxxdG1zCO/TuJUBlnZ4b7p9grhZHM/UOr+8iO4O7ipQ= X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=secunet.com; spf=pass smtp.mailfrom=secunet.com; dkim=pass (2048-bit key) header.d=secunet.com header.i=@secunet.com header.b=MpXUWcIW; arc=none smtp.client-ip=62.96.220.36 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=secunet.com X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=secunet.com X-Received: from localhost (localhost [127.0.0.1]) by mx1.secunet.com (Postfix) with ESMTP id 3A47920743; Wed, 14 Oct 2026 09:38:16 +0200 (CEST) X-Virus-Scanned: by secunet X-Received: from mx1.secunet.com ([127.0.0.1]) by localhost (mx1.secunet.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PG0rncvwrFvd; Wed, 14 Oct 2026 09:38:15 +0200 (CEST) X-Received: from EXCH-01.secunet.de (rl1.secunet.de [10.32.0.231]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.secunet.com (Postfix) with ESMTPS id 8A7DF201C7; Wed, 14 Oct 2026 09:38:15 +0200 (CEST) X-DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.secunet.com 8A7DF201C7 X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secunet.com; s=202301; t=1791963495; bh=1jnFWsYQSFZML/4PrDpytW5QHfSmkatmYDGHzSZn6B4=; h=Date:From:To:CC:Subject:References:In-Reply-To:From; b=MpXUWcIWUWFnRlFfAHm2p+pOR3enzkwbpPW1WYudZ2KINEf/j5LnHHoULnMph/PHp xBXbIh4+WLNA9KleJNqxgy9M/Pr4IUFxgdgZBm8XM+Va1skrUc+7W2xHAwSznynAwv 6nfkaAa28D9RK+wSMKEfLK7Y+wTdyUDUUHN8qi+PEsn7SqGVQV89YnYMKH493rOZgI l9blCOCQKJIC4vbTrK6Owem6OEdHknlKw78FJvaxpVshFgS7yTogJTmWcHP+ce7Ig1 1YW2lPayDozLQfSOTIj1Ku08BfCfWAvGe3psA5zXLwUx+rc2iaBwhqPE8FEF7uFg2+ hODYHNpHA/nFA== X-Received: from secunet.com (10.182.7.193) by EXCH-01.secunet.de (10.32.0.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.49; Wed, 14 Oct 2026 09:38:14 +0200 X-Received: (nullmailer pid 1274379 invoked by uid 1000); Wed, 14 Oct 2026 07:38:13 -0000 X-CC: <netdev@vger.kernel.org>, Herbert Xu <herbert@gondor.apana.org.au>, "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>, <linux-kernel@vger.kernel.org>, Giovanni Vignone <gio@octane.security> 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: <20261007075807.70009-1-shubham@octane.security> X-ClientProxiedBy: EXCH-03.secunet.de (10.32.0.183) To EXCH-01.secunet.de (10.32.0.171)