🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #9516

[PATCH 06/14] xfrm: state: reject mark with bits outside its mask on ALLOCSPI

#9516
From: Steffen Klassert
Date: Mon, 02 Nov 2026 10:04
30 lines
10115 bytes
From: Antony Antony <antony.antony@secunet.com>

Like state add and policy add in this series, ALLOCSPI rejects a mark
whose value has bits outside its mask.

Fixes: bd55775c8dd6 ("xfrm: SA lookups signature with mark")
Cc: <stable+noautosel@kernel.org> # avoid breaking existing userspace ABI
Signed-off-by: Antony Antony <antony.antony@secunet.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
---
 net/xfrm/xfrm_user.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 0723d791b8b7..6b53373168b0 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -1916,6 +1916,9 @@ static int xfrm_alloc_userspi(struct sk_buff *skb, struct nlmsghdr *nlh,
 
 	x = NULL;
 
+	err = verify_mark(attrs, extack);
+	if (err)
+		goto out_noput;
 	mark = xfrm_mark_get(attrs, &m);
 
 	if (attrs[XFRMA_IF_ID])
-- 
2.53.0
Technical Details
Message-ID: <20261102100451.2505200-7-steffen.klassert@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-354514-linux-kernel-netdev=dewy.ru
References: <20261102100451.2505200-1-steffen.klassert@secunet.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-354514-linux-kernel-netdev=dewy.ru
From: steffen.klassert@secunet.com (Steffen Klassert)
Newsgroups: linux.kernel.netdev
Subject: [PATCH 06/14] xfrm: state: reject mark with bits outside its mask on ALLOCSPI
Date: Mon, 2 Nov 2026 10:04:04 +0000
Organization: Usenet Network
Message-ID: <20261102100451.2505200-7-steffen.klassert@secunet.com>
References: <20261102100451.2505200-1-steffen.klassert@secunet.com>
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2877611"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:VS+NuxxHCc7UmKicubleXYvnj1g= sha256:GL8aa7NNWbcNDhFaQvWf+kI2EaywWbb8+/mOXdcnucY=
	sha1:G/FBhhUeS8TXEDLNJs5e3RfW6mE= sha256:Tn9PNshDdCbHg/wXNnv0qOsm47kUD1j56AnN6G/RQfU=
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 F0CD9112457; Mon,  2 Nov 2026 11:07:19 +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.25,
	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=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 5ZTuC5Mumfcb;
	Mon,  2 Nov 2026 11:07:17 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-354514-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 5083A11243B; Mon,  2 Nov 2026 11:07:09 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 8FF332DFA7; Mon,  2 Nov 2026 08:04:57 +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=1793606691;
	b=SB8ytOt+nRjN0Iu2RSgubmKPQvtZLmyIoA94J0m7C5izW9PUxUNByxz9d2cRXiauGaZ9
	 U8Y9voiJnjAaMaGWoCa7aK/d6XvS8f53SWsEb5AfsmQIjw/A6jwCN8aTOznN6jMSMnenR
	 OHKQPCZZoKL7xJp523rWAn/YzE5d6EkLIFuU/XOmAa2oFemUCaZVihUGZD5294gafnKi1
	 VDIJbteiKjUF2o4TqWgdHZZQl6Ib/5xU22OYgZq8ncTVSfknVxcCjs95V/M8WiWDZq+nh
	 +y+t9scxMmxUJxYveHrzNp7bxCqnAHfSy9CW5AeIQeqmb4j/vac3hmXBsP2ybcSjSCg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793606691;
	h=X-Original-To:Received:DMARC-Filter:Received:X-Virus-Scanned:
	 Received:Received:DKIM-Filter:DKIM-Signature:Received:Received:From:
	 To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding:Content-Type:X-ClientProxiedBy;
	bh=03UpySPJVCOP8SE2lkZDKNavFgDv2gCSV/B5O7X4m+w=;
	b=pGUIfSJgQ+PqXkuTUuV3irDvnVuxb5g9S0Fv9vsbugLggst9R+i5FVzXSdjIh4zvJmv8
	 AhZrM8n0rTvGI1gfmLv94/7ul7H2Hq8NgYKQcMuc2MbbVpQXxHAGnWxy0lEECpuTErCIy
	 rPDFwwK/B/gn7KjuGzQ92Q0BZJJMw/md7PAPgLPy3MbAPELQNtZEysa7JAhBQ2yOaFV1P
	 C0osg965IVQinzF8NE8un6uZNVuPAJRKklmZjVDL7DMT76h2O7ExxQZwpJUqeNPRQOEmu
	 z51om/nHehTiXMp5oAW4yJXEoR/4m6FObyw/3OVc4l/NmpXJr+dS3sINAxU0uIPEvrQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=secunet.com header.i=@secunet.com header.a=rsa-sha256 header.s=202301 header.b=XXsxjKxV;
	dmarc=pass header.from=secunet.com;
	spf=pass smtp.mailfrom=secunet.com;
	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 96CEC60A261E;
	Mon,  2 Nov 2026 08:04:51 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=secunet.com header.i=@secunet.com header.a=rsa-sha256 header.s=202301 header.b=XXsxjKxV
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=62.96.220.36
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793606690;
	b=K9hoxEjBu6bUPhWKdmZFp1FlOEi12yCfQn4051l5FWhV7cBar3eCC3DlMvEdev/Fnoox
	 CcdA8IQr40Ib5GjIINn5lBdpQOtLqhcxwZfHH1uKme9oQ3jSN6p5kPzFUDziav9Ku+0hx
	 ahCa5k8EVv91n+bAEwlWRroD+iBgUweVgBYnRuQUCdrbMmk7jfzV/sJP8om9W033NRrEU
	 x1TYIzCoo5YOTsLqLhC3qXGIDHHqKirw03L624mKE8Un8i4g18ChIjxXUyx//Bc4TUzx+
	 9SpNf4Owf2l94zynU1XyS8CeuVKIUnFyt3GJTJ1dtnhPxTgtW5FdKUmqk68H3/CrLcA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793606690;
	h=DMARC-Filter:Received:X-Virus-Scanned:Received:Received:DKIM-Filter:
	 DKIM-Signature:Received:Received:From:To:CC:Subject:Date:Message-ID:
	 X-Mailer:In-Reply-To:References:MIME-Version:
	 Content-Transfer-Encoding:Content-Type:X-ClientProxiedBy;
	bh=03UpySPJVCOP8SE2lkZDKNavFgDv2gCSV/B5O7X4m+w=;
	b=3rGYehfjtmUTrUB4zW0YP8UdH8tYbKL0ocN2jm/aOXQzTGV1B3bBWEcOgX9j8DdDIOXL
	 Bnq+LE0ovqB3+iU600MWkXiwOVIkkMcT6blz9AsNYZwEMC5yzUGOjAURpA0pEpwpvXTTZ
	 OhOPMBme9AECJ1c0nopWQXk8TcXjPX8hYw0n/DAdzdapR9f+76RkSaDDIyoNm+lEYJWxt
	 LQiKYJFaIbg7etTz23ub+UjcwGVvRbLiQyVcQoNKmwucHil3TeYpg50oG80swkny53x3p
	 +OXnJarq2Zy4O6iVySdNejutIkzxuBm3fvMeVxk9vlcZeknBLUNTclBtxLVP7VlQamQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=secunet.com;
	spf=pass smtp.mailfrom=secunet.com;
	dkim=pass header.d=secunet.com header.i=@secunet.com header.a=rsa-sha256 header.s=202301 header.b=XXsxjKxV;
	arc=none smtp.remote-ip=62.96.220.36
X-Received: from mx1.secunet.com (mx1.secunet.com [62.96.220.36])
	(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id C7609606A33B
	for <netdev@vger.kernel.org>; Mon,  2 Nov 2026 08:04:49 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C7609606A33B
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 7A759207C6;
	Mon,  2 Nov 2026 09:04:47 +0100 (CET)
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 quBMGhHg-Er7; Mon,  2 Nov 2026 09:04:47 +0100 (CET)
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 02843207B0;
	Mon,  2 Nov 2026 09:04:47 +0100 (CET)
X-DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.secunet.com 02843207B0
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secunet.com;
	s=202301; t=1793606687;
	bh=03UpySPJVCOP8SE2lkZDKNavFgDv2gCSV/B5O7X4m+w=;
	h=From:To:CC:Subject:Date:In-Reply-To:References:From;
	b=XXsxjKxVBQBw1OOWKUhVjPqld4+u843zuJN8cxYVjj1rVBaC8dQSqnYk38SDfEasj
	 y7aGJKIO1iuNUMtqjjX7mxo4tw15VMWt5KcyWa1hbwJ1zmv8nN7vCcDky5yoyomKbB
	 VPeySvEZyHxCjTzgl3h56SYX/KJcO0gPUVwomJhR6wQT29MlhSJn1a9u4DbqI6FWgE
	 RiHm42Fw1AwtGuPUIioA3KdDRgD/gWbYsCyU+n4DkcuYDXOYphb8K0Vajup1z/olfr
	 bznnWV0IqZw/3ZPj52n62nQIEirMfd+EGOiuR+6QBnRTuWPKEuKbg69DQ1jAFl2Esc
	 9vxeGDKgQj/EA==
X-Received: from gauss4 (10.182.7.102) 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; Mon, 2 Nov
 2026 09:04:46 +0100
X-Received: (nullmailer pid 2505906 invoked by uid 1000);
	Mon, 02 Nov 2026 10:04:58 -0000
X-CC: Herbert Xu <herbert@gondor.apana.org.au>, Steffen Klassert
	<steffen.klassert@secunet.com>, <netdev@vger.kernel.org>
X-Mailer: git-send-email 2.53.0
X-In-Reply-To: <20261102100451.2505200-1-steffen.klassert@secunet.com>
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-ClientProxiedBy: EXCH-01.secunet.de (10.32.0.171) To EXCH-01.secunet.de
 (10.32.0.171)