Article View: linux.kernel.netdev
Article #22575Re: [PATCH V2 rdma-next 21/21] RDMA/core: Report and enforce adversarial mode via GET_CONTEXT
From: Jason Gunthorpe
Date: Wed, 25 Nov 2026 14:45
Date: Wed, 25 Nov 2026 14:45
53 lines
13205 bytes
13205 bytes
On Wed, Nov 25, 2026 at 11:03:09AM +0200, Leon Romanovsky wrote: > > What do you mean? This is a mechanism to help the user manage software > > versions by not accepting incompatible rdma-cores. > > Please take a look at the patch. > User space provides that new adversarial flag. > > + ret = uverbs_get_flags32(&ctx_flags, attrs, UVERBS_ATTR_GET_CONTEXT_FLAGS, > + UVERBS_ATTR_GET_CONTEXT_FLAG_ADVERSARIAL_SUPPORTED); > + if (ret) > + return ret; > + > + if (ib_dev->adversarial_mode && > + !(ctx_flags & UVERBS_ATTR_GET_CONTEXT_FLAG_ADVERSARIAL_SUPPORTED)) > + return -EPERM; > > ... > + UVERBS_ATTR_FLAGS_IN(UVERBS_ATTR_GET_CONTEXT_FLAGS, u32, > + UA_OPTIONAL), What's the issue? If the user space doesn't ACK it has the new software then it doesn't create the context? This is how we do every feature that needs rdma-core support, though more often there is a fallback in the kernel. > The kernel does not care whether rdma-core is up to date. It works either > way, so why should we prohibit older userspace on these systems? What do you mean? + if (ib_dev->adversarial_mode && + !(ctx_flags & UVERBS_ATTR_GET_CONTEXT_FLAG_ADVERSARIAL_SUPPORTED)) + return -EPERM; That is not "works either way" that is requiring new software. Which is exactly what I want to see here. > > It is not a security mechanism to hard guarantee that rdma-core has no > > bugs. > > It is you who talked about "... security downgrade ...". Yes, in that I want people using normal software to have a safer more secure experience. Meaning you need supporting rdma-core if the kernel is in adversarial mode, because otherwise you don't get the right security outcome. You took it to some absurd scenario of a user hacking their rdma-core to defeat the check, which is not the point at all. Jason
Technical Details
Message-ID:
<20261125144521.GI246011@ziepe.ca>Path:
mbox-mo1.pugleaf.net!news-can.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-371417-linux-kernel-netdev=dewy.ruReferences:
<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> <20261124143024.GO9566@ziepe.ca> <20261125090309.GY14811@unreal>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-371417-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: Wed, 25 Nov 2026 10:45:21 -0400
Organization: Usenet Network
Message-ID: <20261125144521.GI246011@ziepe.ca>
References: <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>
<20261124143024.GO9566@ziepe.ca>
<20261125090309.GY14811@unreal>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
logging-data="232172"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:LgeAR+3H9wH69Msm9uQ+G++i8Po= sha256:CY+Or/AR2LTpxZ2pKXPdB1R1oncfc50ipxoID9R/Jbg=
sha1:e7IkmYIU5+0JziSa3nPm+5xEGkA= sha256:FC92UsHt1knaxic4Z8uLeUoPbE360Dftp52/uMwLmGg=
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 72E80125E72; Wed, 25 Nov 2026 17:45:39 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.15
X-Spam-Status: No, score=-3.15 tagged_above=-9999 required=6.31
tests=[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 3nUkA63Io614;
Wed, 25 Nov 2026 17:45:35 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-371417-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
by mail.dewy.ru (Postfix) with ESMTPS id 31FAC125E6E; Wed, 25 Nov 2026 17:45:27 +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 6AFD6341D5; Wed, 25 Nov 2026 14:45:25 +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=1795617924;
b=WCegBTjmiMOWkWv3P156p3AnCqllFryu7oigPm3dmJch4dveavOe5A2OY9l6JBXje2kW
134Vo2r2ZhAobekbVo8U4wOgrWYKPzhJaVCWyHBaZa5dEUUgQ8JCk3S+2hpdIiCJ4JYOd
Q8RST0+kw6/j08V4TFEmpyyTgP03vkuYMjoI/VxC/BhZUeKqt6+b2EXc6OiJD0B92btCO
WthQPbggh0eiECd7JC9e6k7xKR69bZX2Oe/oiJ9QNO95+NCXqBzwb1hjbsT12+vGm3QgR
ALgnRoVyA4LO1Gfggxn471wywNVhVcu4fTH+h/s7+2RRmjokCFkI1YnoEb62KgDbItQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795617924;
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:In-Reply-To;
bh=GQIqrvkEuCQaYgl8JZYA17fRuuRBiz0DeFEwMWUBlxE=;
b=roRT7qXNM25ZTBlzhgdECmo78phZoTQtSG9MXL7YiVe3D3yqykgLb6zQ8R27aoDwgUyF
SJg/3MGfuldGinHW0CnewDbvkXJh5n7wj4uBqrTqMmT1xigJlM9t0V58jKlPzi6TZD8Oq
4M9fOtaq2mQFjlRv2ueeZ8xWlxKXdyZsLFLKxy4+jOAe4EkPivVv2tc7e8YpZ/LpFDXUt
q2S6vIwTG+JbbNfTdsiETOxVBKXioW2sjSqbh0gD+D3S1L9UqUqA9oqUt26Vrrma6K8iH
0Xvv/x+j00mr2A88yOUXOE/ND/VgnCxzPNlzJSWuXF/QoK/o6xejMMK+Q09f3BwZR3A==
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=GfHorJdx;
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 D5BE4606A339;
Wed, 25 Nov 2026 14:45:24 +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=GfHorJdx
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.222.173
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1795617924;
b=iaBTu0HcrekYlPFFSTJnb2pVDivFxFS3+ymmy0H9OFkxABPrL2TlhgAegQxqS3I475eM
t4FV7QxHba2lEhtepaGjdYdGCdd2LNvAe7sJ9G1PowZ1x177QNlci/NOH93G0M8VNPmg8
VCua4G+0414ikKcErwTZF/NBEzjMCHHIL86IUPKKKzImUbU6XrVCvyAWQuPe/ksRbpQ/G
yw70G7MnNwx87Ndkg6fSshfK1mBjuXN8MzS7tyY1+k78J2EGzhPLoUKkVi7D5X27hBMHT
A189F6Wj3R1tyfYXrPMsTcodUc+IMF4lK3rURlzrNTBuhalymZVi/BJU/sDV1Buel+w==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795617924;
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:In-Reply-To;
bh=GQIqrvkEuCQaYgl8JZYA17fRuuRBiz0DeFEwMWUBlxE=;
b=1JI0UEOfrelVm4LWqfmXs8p0VmbYFnGy8tRgSwkWaCzjeWfV2HedB6E8D4dGmxpohwqS
UlK79xbXpFTUiR+AmzXdvQufsmzmAx4Uyv9d+8iHBywcO+Lg3G8jmEe1zSKSsxCcqyFJX
jQ757RDb0y7RLQ94zuubzVRottapMRHMAhD4LjpbGdlP/Z9FkhbF3rzm2x1jKqwREmVtr
L02qmUee7bg39eN6ECL4yywY6I1HqmdvbackRop80FguMH/+lO38KfB4l5oCBVNQ+RPx9
sWyvgXNoxj8epQW/npne5CB14IJjDEsA8xu3R1DlPANseratn/Y9TX2QgYgMVayCSNA==
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=GfHorJdx;
arc=none smtp.remote-ip=209.85.222.173
X-Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173])
(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 9C058606A327
for <netdev@vger.kernel.org>; Wed, 25 Nov 2026 14:45:23 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9C058606A327
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-f173.google.com with SMTP id af79cd13be357-94961d90b79so612599885a.3
for <netdev@vger.kernel.org>; Wed, 25 Nov 2026 06:45:23 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=ziepe.ca; s=google; t=1795617922; x=1796222722; darn=vger.kernel.org;
h=in-reply-to: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=GQIqrvkEuCQaYgl8JZYA17fRuuRBiz0DeFEwMWUBlxE=;
b=GfHorJdxm/Tm/nk4NUjeAJQJeMDopYjbHRxpuzqoYvpqO3p4antAF9Co8gVV9g2PyA
D+jEJvpcvNWs8JcznIBLvvI6KVXvooCwh1nHS41khHRAT+PPGeO/UsbuQiLLN4qglPfq
QLJh+SV2O/J9aX4fleNQ/yXAxWIU21F5ryaFCt1ewGBY0rJxTkRvmr7Y+D9KNsR348Ke
4VMocHdeZqjkQzWEJoUCRhhNC7TEWSHXg7Jn2gULsuOvbM9z5sgLSwQqCPcsSb188vFb
Od3OsLXLJv9gyijuBwth+ELtyRHOI5qlbVseSdKjv8ldSPwWObeNyteRxVKytQu0/Zov
u9hg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1795617922; x=1796222722;
h=in-reply-to: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=GQIqrvkEuCQaYgl8JZYA17fRuuRBiz0DeFEwMWUBlxE=;
b=nyQR7s/9JbTT3Wb/2lSzJIgXFdNhd6DeSOdO+cI6+tFOY3vsX4K3sEL9b3uVtwC+PP
x9OSqNIMC8j2oV4tktFY5pLXs5N/VNIiZTUc9H+cf+cMh6VWjSB8Bzv+PYtLW8bNpuK6
RPUQdVlNPx420aiFDrMiZt+TTBV4zpw+Cz/0OXrWWfxI1QmlrBy+Vbvf+Y9goPQ06I6H
RT2/fM/rPCDB3NgvHc5YPKMyr0tBkZ/VKU5259K1/WUTsdLnNDCHkuzrtJ4vzf13MUbX
TGmFdSgmXRk6+FSzP5sOUvSN4HwdyHXKTUOplhAaaqdVfIzZe2T9LeM97N1818Z6s4kG
n4Jw==
X-Forwarded-Encrypted: i=1; AL+hErHZ1tn2OaoQZd5zdEACRvmpZn8Yg45icGRh3ZpvgTjSXVD4cmdyiVop2QExv1PSpH9qlU0+i5k=@vger.kernel.org
X-Gm-Message-State: APuU4Z97hpbGI6SUJ9UH6yYKtVF2irhA2w/caIbLq4dsflmya8vmfxlL
Ng1Fp2SMSwnvAktVeqM+rmnQocK/emFwHDcmceIyk/vQEi1pat59PiCl+y7tyO9cnLw=
X-Gm-Gg: AZFdTZe+VOHk8ss6jkZRSyCCZdLLQ/kcZpQcuKo0eeE4rm6M2VA9rj2ieKeQOLkqB43
GcXM322UVwdrvuBwPNCfEerxu5BjA+UExDvSsZW+ANU1K5tN57/ooZniPR4ts9zQOPXgaqEK4ZG
OmET2KQKcsTAk4JE+FbjhUPhwN07Xb4I32WxDKZGz3jbLxbpDDfZq0TtKgO0J4YhHXuPMDGZHAL
OouRhkZm8PkJBJs5NGZ4bEwKe+eSpV6xKifKuoonr2gG4dl2T4H+fhAn7bIejZieNCe9FAeMGWA
Hp829ofD4gAp5/USWeOfyepw5b37SJB7StufiNPDUwBc8C8KBc23tNvXEhuZ7dtMz1dvKhn6fLK
2HBj449eRD/czdTkvtcg4tDVLlcv9auyWx/W/95BNFsC7A6ED68i2cW+YGLZUoDIbXFj2sp5rFm
DzxYcEaGFEhnyFWwDkmFDJiDLXRp6AC+0tm2B9msw/Ju5jezE32F/ydzM8lklFN87E4LtQaptPK
/4vaHcniCRUESGNYPpo1SNshXoEBZUaszc0D278jNeIAtAoa2Kgz4gZxkYX7e0rIx3yyfusjM12
EaQMlQ==
X-Received: by 2002:a05:620a:6487:b0:949:9a8c:7052 with SMTP id af79cd13be357-949bab1577cmr2699750285a.70.1795617922348;
Wed, 25 Nov 2026 06:45:22 -0800 (PST)
X-Received: from ziepe.ca ([142.177.118.84])
by smtp.gmail.com with ESMTPSA id af79cd13be357-949bb38319asm1327544785a.16.2026.11.25.06.45.21
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 25 Nov 2026 06:45:21 -0800 (PST)
X-Received: from jgg by wakko with local (Exim 4.97)
(envelope-from <jgg@ziepe.ca>)
id 1xWEFN-00000001mSD-154e;
Wed, 25 Nov 2026 10:45:21 -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: <20261125090309.GY14811@unreal>