Article View: linux.kernel.netdev
Article #21847Re: [PATCH V2 rdma-next 21/21] RDMA/core: Report and enforce adversarial mode via GET_CONTEXT
From: Jason Gunthorpe
Date: Tue, 24 Nov 2026 14:30
Date: Tue, 24 Nov 2026 14:30
55 lines
14107 bytes
14107 bytes
On Tue, Nov 24, 2026 at 04:09:06PM +0200, Leon Romanovsky wrote: > On Tue, Nov 24, 2026 at 09:47:51AM -0400, Jason Gunthorpe wrote: > > On Tue, Nov 24, 2026 at 03:33:53PM +0200, Leon Romanovsky wrote: > > > On Tue, Nov 24, 2026 at 08:59:50AM -0400, Jason Gunthorpe wrote: > > > > > > RDMA/core: Report and enforce adversarial mode via GET_CONTEXT > > > > > > > > > > > > In adversarial mode the NIC is not trusted. As the kernel protects its > > > > > > own code from it, user space has to protect its own area, e.g. the data > > > > > > path that polls CQEs directly from the HW. > > > > > > > > > > > > Hardened user space might use a different data path, with extra checks, > > > > > > and support a smaller surface. This isn't needed for a trusted NIC, so user > > > > > > space must know when a device is in adversarial mode. > > > > > > > > > > This information is part of trust level series. Why is this a “must” in RDMA UAPI? > > > > > > > > Userspace has to work differently if the kernel driver is in the > > > > adversarial mode, and the kernel should not permit an old non-supporting > > > > rdma-core from loading to prevent a security downgrade. > > > > > > I understand the first part of the sentence above, but the second part is > > > unclear. Why should this prevent it? In adversarial mode, the kernel simply > > > isolates that device from the others. > > > > Userspace needs to do it too or it is not a complete defense. > > > > > Moreover, the kernel cannot determine whether rdma-core has actually been > > > adapted. A locally cloned version of rdma-core can set the new adversarial > > > flag without changing the old, legacy version. > > > > > > Once that flag is set, the kernel allows the patched rdma-core to proceed. > > > Therefore, saying that it “should not permit” this makes no sense. > > > > If someone makes a non-official version of rdma-core that doesn't work > > securely then I don't care one bit. > > > > I care that the official versions are not improperly mismtached to > > give something insecure. > > You explain why rdma-core needs to know about adversarial mode, which is > fine. However, you also say that rdma-core MUST send this new flag back > to justify the statement, “The kernel should not permit an old, > non-supporting ...”. > > However, in your last reply, you said that the kernel does not actually care about > the rdma-core mode. What do you mean? This is a mechanism to help the user manage software versions by not accepting incompatible rdma-cores. It is not a security mechanism to hard guarantee that rdma-core has no bugs. Jason
Technical Details
Message-ID:
<20261124143024.GO9566@ziepe.ca>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370441-linux-kernel-netdev=dewy.ruReferences:
<20261117170914.27410-1-yishaih@nvidia.com> <20261117170914.27410-22-yishaih@nvidia.com> <20261122073156.GA12665@unreal> <761ca80e-a772-41f3-b8e9-cc332e4ba5d9@nvidia.com> <20261124125327.GR14811@unreal> <20261124125950.GC9566@ziepe.ca> <20261124133353.GT14811@unreal> <20261124134751.GJ9566@ziepe.ca> <20261124140906.GU14811@unreal>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370441-linux-kernel-netdev=dewy.ru
From: jgg@ziepe.ca (Jason Gunthorpe)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH V2 rdma-next 21/21] RDMA/core: Report and enforce
adversarial mode via GET_CONTEXT
Date: Tue, 24 Nov 2026 10:30:24 -0400
Organization: Usenet Network
Message-ID: <20261124143024.GO9566@ziepe.ca>
References: <20261117170914.27410-1-yishaih@nvidia.com>
<20261117170914.27410-22-yishaih@nvidia.com>
<20261122073156.GA12665@unreal>
<761ca80e-a772-41f3-b8e9-cc332e4ba5d9@nvidia.com>
<20261124125327.GR14811@unreal>
<20261124125950.GC9566@ziepe.ca>
<20261124133353.GT14811@unreal>
<20261124134751.GJ9566@ziepe.ca>
<20261124140906.GU14811@unreal>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="4157831"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:/35/Uo8yQzVkYL6wycpSovzkjuw= sha256:o7xC/bVWUoGvIeW5REJx++qThQGuBL4t1fmaz1ZLo08=
sha1:oG2DSmlTOL95P7Z1G04BFxYkzbI= sha256:fQ6bNRPwgk0lXZyI53pzXWtwyCcxZ+ahqsvaA8yM+Ek=
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 9A17E125E19; Tue, 24 Nov 2026 17:30:45 +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=ziepe.ca
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 OLRj5PO-yZkY;
Tue, 24 Nov 2026 17:30:42 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-370441-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=ziepe.ca
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 12449125E16; Tue, 24 Nov 2026 17:30:34 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sea.lore.kernel.org (Postfix) with ESMTP id 7273339BB5; Tue, 24 Nov 2026 14:30:30 +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=1795530630;
b=dvXiS8My+i1jlOswnaUPzTrWyiH+2LpiA8vw2IqdmdqgTW7tNmoGefdEw5vvJ+GMPmWi
r7qUPU2WoanRgEKr+OuXjgm5gwSW0y60/2/mjk75+wFmKicTnMrANesdqzFYy3d8DE38g
9j4LnSBRkOBb7CPNNH8iJz9ZS8iPG46wD+X8e+GW71DsJnxtbc3NTMZUom9NR8UDLernl
VHtnYg9sWWBFFjJmEAqX2pUN0z/fcdTm6IucXsCwdnSUORBhWoC93e4S4NcKAV77ctlAN
pLNOxvT9JrKFT76JY2UOjIJ9yrFomBhqojWL0msdvY0/wamkvpJG/AFfYg0XzlJkZuQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795530630;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
X-Gm-Gg:X-Received:Received:Received:Date:From:To:Cc:Subject:
Message-ID:References:X-Mailing-List:List-Id:List-Post:List-Help:
List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
Content-Type:Content-Disposition:Content-Transfer-Encoding:
In-Reply-To;
bh=jVFdSwnS47EFl8UcZbr6GAKJGNG0CDFPn0KaTVMkw9w=;
b=T9GrNDGvVRIm6h/DBMGx7+fT9pRHQZdfz+cdyaqCoFVjhl/w0W5+Mrr/aaTJgxhqolSs
atG/iefFwxUPqyPQ9MaUs3wwd2uCQn5RK77wPpVm+i97yT6IkZ+YHOWN7JVzardps3inh
2ZBrEonxVWw5STP4yytMMbmbDHvFS2TLFp6unTzbWhxG1fjIm8wX10hV5qHHrbNOs1GL/
ShZLfVVxTepH1Qa8PmmKDAvFpH5OoLH93BtbQ5s4GOrP0qL26iep8Usto+TCv79L72LBS
7SrMOG61vIHBBQKfWOGHgIAwZlwsjWi3Li7sk88GpIDxw61F7zY38vp8lZ6Jh308CCw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=ziepe.ca header.i=@ziepe.ca header.a=rsa-sha256 header.s=google header.b=G3Eb1aSi;
dmarc=none header.from=ziepe.ca;
spf=pass smtp.mailfrom=ziepe.ca;
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 34463606A329;
Tue, 24 Nov 2026 14:30:30 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.a=rsa-sha256 header.s=google header.b=G3Eb1aSi
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.222.178
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1795530629;
b=wjg4IHLZ4IMH5rn2qllyuuMHVua75CdcJacAiX5VpWbCn67KIe9J3XurnAeGVNffJQJi
Ukr1zRL8Ghw0hSoiQQasq6v55ro3rFA7G6d+RXLxwtPtKtmGPT2d7VsV1r8nzu9+F4Fvd
/BWnsoOUMUCh4ZSSSaG1340zYzSJbEh7qC2kg/mSEi75OTGNS9gZ4/iccb7Z4F3FSuKoI
Yw8qKNKV5youp9yXZz9fUcPOghWlkQ1X8vMw8FfEKEQKygZoQlSellsL7bAZ/DAZUTNGu
Km2n4yXKFlETxUTzfJ9XFqorCphngsFPNA4HVxxdk0DnaOsrlMhyszcBspuCXbOnx4g==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795530629;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
Received:Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
Content-Type:Content-Disposition:Content-Transfer-Encoding:
In-Reply-To;
bh=jVFdSwnS47EFl8UcZbr6GAKJGNG0CDFPn0KaTVMkw9w=;
b=ZXvf1HQk5gfjlGOWJRrlkgaUjACXjDaKx9K/7Q7GcWsDd/Si7wzwwWdznzsTf2qI65Vk
SWZa9hJ0EDUztNeeVKmIj5YBB76wExmczL49kyddVEZwCYb/PcusVQxSMlsFhdqXaJ7Ra
gZUAoC3pSNb9wydyvmKOTKAAXWhHnn8r/jzAL47LJ4Mn2wyxF63LoIVYo+KgWfQeDvAdL
rA6SsVE09C6keNSb+QWdwx1rHsK8MWPf8hgHsc6TDGrwaSb4dssrx9JK9d08RHFWowofJ
K7dJNxxELv7yqFKIUjAmwIe6EQMVY8i5xOZ0tyuwAcMSTW6aRiGsXl8PH+sywzpu5bg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=none header.from=ziepe.ca;
spf=pass smtp.mailfrom=ziepe.ca;
dkim=pass header.d=ziepe.ca header.i=@ziepe.ca header.a=rsa-sha256 header.s=google header.b=G3Eb1aSi;
arc=none smtp.remote-ip=209.85.222.178
X-Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id E50C7606A31E
for <netdev@vger.kernel.org>; Tue, 24 Nov 2026 14:30:28 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E50C7606A31E
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca
X-Received: by mail-qk1-f178.google.com with SMTP id af79cd13be357-949589c1495so410417085a.3
for <netdev@vger.kernel.org>; Tue, 24 Nov 2026 06:30:28 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=ziepe.ca; s=google; t=1795530628; x=1796135428; darn=vger.kernel.org;
h=in-reply-to:content-transfer-encoding:content-disposition
:content-type:mime-version:references:message-id:subject:cc:to:from
:date:from:to:cc:subject:date:message-id:reply-to:content-type;
bh=jVFdSwnS47EFl8UcZbr6GAKJGNG0CDFPn0KaTVMkw9w=;
b=G3Eb1aSiZGOuAbMP0/V4MCpuAFp4RHwcDx0YgPHKuJI85WOxFXaykXGDBOrUxp5hxI
svqhv+lcU5Xn2WoHRkKis0zSWzRWpZP4x+YBKOl+HiJQ3F/jI5rLYL1C1GSQhkZTKoX0
RuY/B6M/MHr3FyhUjfEAgBPtdaUFmTn72E6OyprhGxlogNACnzUPeRT5V8u2s/vW8R8n
UqMNNvMgdLU8g7SJ+K5wcVTEDD/apQLocUlnskMmJGi36NBcWcgQGarHoh5qGGb5073f
++iqhwwJfUr7XuPmBCdx/47VnFNkSnTPcnpTvjlVH8sR1YSOMhDL+N2nYTqscjMyU9xm
aT7Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1795530628; x=1796135428;
h=in-reply-to:content-transfer-encoding:content-disposition
:content-type:mime-version:references:message-id:subject:cc:to:from
:date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to:content-type;
bh=jVFdSwnS47EFl8UcZbr6GAKJGNG0CDFPn0KaTVMkw9w=;
b=cjBeeyuRh0RomQFVUJCexfiVA2peBryVKaWJogxSDwGhQpk0H7+xXMcOqwwYw45NoO
1+JE4/8Wav06PJRPP5dbCUIOPdM7Za1fOjDre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Xb0uF0OZA9poqm8kMQRSw7Rjl
bd/5xw==
X-Received: by 2002:a05:620a:bd3:b0:93c:6417:f9c8 with SMTP id af79cd13be357-949ba9b3e00mr2686641385a.29.1795530625685;
Tue, 24 Nov 2026 06:30:25 -0800 (PST)
X-Received: from ziepe.ca ([142.177.118.84])
by smtp.gmail.com with ESMTPSA id af79cd13be357-949bb031617sm1047656585a.1.2026.11.24.06.30.25
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Tue, 24 Nov 2026 06:30:25 -0800 (PST)
X-Received: from jgg by wakko with local (Exim 4.97)
(envelope-from <jgg@ziepe.ca>)
id 1xVrXM-00000000SA4-25fy;
Tue, 24 Nov 2026 10:30:24 -0400
X-Cc: Yishai Hadas <yishaih@nvidia.com>, linux-rdma@vger.kernel.org,
netdev@vger.kernel.org, saeedm@nvidia.com, tariqt@nvidia.com,
mbloch@nvidia.com, kuba@kernel.org, pabeni@redhat.com,
edumazet@kernel.org, davem@davemloft.net, andrew+netdev@lunn.ch,
dtatulea@nvidia.com, moshe@nvidia.com, maorg@nvidia.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-In-Reply-To: <20261124140906.GU14811@unreal>