🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #90

Re: [PATCH] xfrm: zero-initialise km_event in replay-notify to stop stack disclosure

#90
From: Steffen Klassert
Date: Wed, 07 Oct 2026 06:54
24 lines
7851 bytes
On Wed, Sep 30, 2026 at 03:01:37PM +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() copies those two fields into the
> XFRM_MSG_NEWAE netlink message header via
> nlmsg_put(skb, c->portid, c->seq, ...), and the message is multicast to
> the XFRMNLGRP_AEVENTS group, so two dwords of uninitialised kernel stack
> are sent to group listeners on each replay event.
> 
> 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 uninitialised. Zero-initialise the event so the header
> fields are sent as 0, the correct value for a kernel-originated
> notification.
> 
> Reported-by: Giovanni Vignone <gio@octane.security>
> Assisted-by: LLM
> Signed-off-by: Shubham Antil <shubham@octane.security>

As this is a fix, please add a 'Fixes:' tag.

Thanks!
Technical Details
Message-ID: <asXss4xSHDfrkMFs@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-342223-linux-kernel-netdev=dewy.ru
References: <20260930093137.7163-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-342223-linux-kernel-netdev=dewy.ru
From: steffen.klassert@secunet.com (Steffen Klassert)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH] xfrm: zero-initialise km_event in replay-notify to stop
 stack disclosure
Date: Wed, 7 Oct 2026 08:54:43 +0200
Organization: Usenet Network
Message-ID: <asXss4xSHDfrkMFs@secunet.com>
References: <20260930093137.7163-1-shubham@octane.security>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Injection-Info: usenet.network;
	logging-data="593770"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:+1NXLppA3VaAexQmSq+CDxuKXDM= sha256:ZvWcG554E1caUA31+bTgUhcJFVjjlDQIp7xb6Z7dXH4=
	sha1:oBB4CekA7Ke4F1RRri/Vik986Do= sha256:SHoR6XKK4yOkN1ux2TLVbumt5CoR+lh3gC4tcHZyKJc=
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 E1BFF10F0F8; Wed,  7 Oct 2026 09:55:11 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 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, RCVD_IN_DNSWL_MED=-2.3, 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 (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 IomcjbNhpVOd;
	Wed,  7 Oct 2026 09:55:09 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-342223-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 34EA910E23E; Wed,  7 Oct 2026 09:55:05 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by tor.lore.kernel.org (Postfix) with ESMTP id 8DA312D01A; Wed,  7 Oct 2026 06:54:52 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 17A9840B112;
	Wed,  7 Oct 2026 06:54:50 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=secunet.com header.i=@secunet.com header.b="H7BfHDaD"
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 B75A1331EB3;
	Wed,  7 Oct 2026 06:54:47 +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=1791356090; cv=none; b=cDr/08jqU7g6WQKPM1NtpJbaCXFspxNjw/V1q+K6iZghP+AF1fbMKz2wX875NtZDNN4X7AJlYliMmgB2qCzc1iOnJWE9oZFmLXaDqfcZNHtjwZ605q6MMeFSybHGdu4jWnzULWM+rFebJzES0MNes8Sf2WujQ9ONiorfsuuqa8E=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1791356090; c=relaxed/simple;
	bh=Set3kyt3NGr6wdIc4vkbYWiU/oTejxt+HTBAA9PyjQA=;
	h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version:
	 Content-Type:Content-Disposition:In-Reply-To; b=dFme4ytYs8GkYmreEZxHRoVdQ/fNnOwQeXjjeeB58w6/6AMWs8xWe98zZ7a+cawXUTKTZPCwdW1tpYODCzsWOvpQ3p5+K6cl3s1AAjuFvPKxuD2ZZPVDlheIfGksT989lxkPtB9u+k3ArGGwr0G+M/HWINHkli+pOXwpeYn3oFM=
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=H7BfHDaD; 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 833712083B;
	Wed,  7 Oct 2026 08:54:45 +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 TiOHKnZ_-_TI; Wed,  7 Oct 2026 08:54:45 +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 EEC1020839;
	Wed,  7 Oct 2026 08:54:44 +0200 (CEST)
X-DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.secunet.com EEC1020839
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secunet.com;
	s=202301; t=1791356085;
	bh=JJnaSOMtHtuqb4es19bM70PlTRZ/QHFRk+6jKp6Bq8M=;
	h=Date:From:To:CC:Subject:References:In-Reply-To:From;
	b=H7BfHDaD7CypmYxSA5GLVZqlKh5sJJfWky+MinRkMk591IF+RfDXz6IRQDrH7WdaS
	 +rZFrdj4UMfMNvrEiNPFDEktdAx0hExzx1cqFBhp3TFffIcADTEv4nEYhRDt5hEakv
	 vtWb2ChfrgEeYHbDIHAi0axpvCMfUKGjD0p3PZ/+85lPAcmFfRbYvZMIiqLLMmkbHr
	 CbrU9IT8YP00IoG92oOghUP1PktoeaPuCJL+lJNI77LOz90ZiqGYKdOJczPwgxeD6F
	 qstirYYEUnH20fucxFTjW61ScLXDhCJzGFn3qkKYci3c1qJbOBiNCgfDbY0rzhvd1+
	 GjMn6JLMxQoFg==
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, 7 Oct
 2026 08:54:43 +0200
X-Received: (nullmailer pid 3308355 invoked by uid 1000);
	Wed, 07 Oct 2026 06:54:43 -0000
X-CC: 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>, <netdev@vger.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: <20260930093137.7163-1-shubham@octane.security>
X-ClientProxiedBy: EXCH-03.secunet.de (10.32.0.183) To EXCH-01.secunet.de
 (10.32.0.171)