Article View: linux.kernel.netdev
Article #18150Re: [PATCH iwl-next 09/15] idpf: psp: add support for psp key rotation
From: "Daniel Zahka"
Date: Tue, 17 Nov 2026 22:15
Date: Tue, 17 Nov 2026 22:15
74 lines
14323 bytes
14323 bytes
On Tue Nov 17, 2026 at 9:55 AM EST, Stan Iliev wrote:
> Add support for PSP master key rotation:
> - Introduce VIRTCHNL2_OP_PSP_ROTATE_KEYGEN_REQUEST (563),
> struct virtchnl2_psp_rotate_keygen_request/_response,
> VIRTCHNL2_EVENT_PSP_ROTATE_KEY (4) and
> struct virtchnl2_psp_rotation_event/_data.
> - Implement the key_rotate PSP device op with
> idpf_psp_rotation_request(), which fails with -EOPNOTSUPP if
> VIRTCHNL2_CAP_PSP_REQUEST_ROTATION was not granted. The PSP core
> increments the PSP device generation before calling the op and
> doesn't restore it if the op fails: the op restores it then.
> - Track the master key of the allocated RX SPIs, to report their
> generation on receive in a later patch: bit 31 of an SPI selects one
> of the two master keys of the CP, and the CP master key generation
> of the allocation tells when a master key was replaced. The packets
> of a master key get the PSP device generation that was current when
> its first SPI was allocated, which is the generation of the
> associations using it. Associations then survive one rotation, as the
> PSP core expects.
> - Handle VIRTCHNL2_EVENT_PSP_ROTATE_KEY in idpf_recv_event_msg() with
> idpf_psp_rotation_event(), which logs the new master key generation.
> The PSP core can't be told about rotations it didn't request, like
> in mlx5: document the limitation and a possible solution.
>
> Signed-off-by: Stan Iliev <stani@google.com>
> ---
[...]
> +/**
> + * idpf_psp_rx_gen_update - Track the master key of an allocated SPI
> + * @adapter: private data struct
> + * @psd: PSP device, locked
> + * @spi: SPI allocated by the CP
> + * @cp_gen: CP master key generation of @spi
> + *
> + * Bit 31 of an SPI selects one of the two master keys of the CP, a rotation
> + * replaces the older one. The HW doesn't tell which master key decrypted a
> + * packet: report the PSP device generation that was current when the first
> + * SPI of the master key was allocated, which is the generation of the
> + * associations using it, see idpf_psp_rx_process_skb(). The CP master key
> + * generation tells when a master key was replaced, including by a rotation
> + * the PSP core didn't request, see idpf_psp_rotation_event().
> + */
> +static void idpf_psp_rx_gen_update(struct idpf_adapter *adapter,
> + struct psp_dev *psd, __be32 spi, u32 cp_gen)
> +{
> + struct idpf_psp_rx_gen *rx_gen;
> +
> + lockdep_assert_held(&psd->lock);
> +
> + rx_gen = &adapter->psp.rx_gen[be32_to_cpu(spi) >> 31];
> + if (rx_gen->gen != IDPF_PSP_GEN_UNKNOWN && rx_gen->cp_gen == cp_gen)
> + return;
> +
> + rx_gen->cp_gen = cp_gen;
> + WRITE_ONCE(rx_gen->gen, psd->generation);
WRITE_ONCE isn't paired here. I'm guessing the Rx code in series 2 will
copy rx_gen->gen into the psp skb extension, but that would likely not
be correct. The generation field in the extension should be copied from
Rx completion metadata. If such a descriptor field doesn't exist, then
the key_rotate() implementation might as well pin psd->generation = 0
like mlx5 does.
> +}
> +
Technical Details
Message-ID:
<DMXTZHJA6OGI.3RFGSK5SE9RUF@gmail.com>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-365660-linux-kernel-netdev=dewy.ruReferences:
<20261117145522.1910636-1-stani@google.com> <20261117145522.1910636-10-stani@google.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-365660-linux-kernel-netdev=dewy.ru
From: daniel.zahka@gmail.com ("Daniel Zahka")
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH iwl-next 09/15] idpf: psp: add support for psp key
rotation
Date: Tue, 17 Nov 2026 17:15:07 -0500
Organization: Usenet Network
Message-ID: <DMXTZHJA6OGI.3RFGSK5SE9RUF@gmail.com>
References: <20261117145522.1910636-1-stani@google.com>
<20261117145522.1910636-10-stani@google.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
logging-data="2440729"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Hvgr+70Wq1UxELyGLt1bUY/nnd0= sha256:oTOp+e36iUyKsUg5A8ms3Vc7skTyQ+xn5/5B+45hiq4=
sha1:FR1vvf/ox2YNCawrd3V+uds4+Do= sha256:Jp7sTQmc1htDfwibq6+Hph6yr4/cAPqJDMH6nZlxb8U=
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 714C61150C8; Wed, 18 Nov 2026 01:15:30 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 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, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, 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] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.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 OYB9XH_v3H9F;
Wed, 18 Nov 2026 01:15:26 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-365660-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id B4C86115068; Wed, 18 Nov 2026 01:15:16 +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 59BB63F885; Tue, 17 Nov 2026 22:15:12 +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=1794953711;
b=HeST9o6CYDZhg5ZZCtJRzPWsFTPHakJRxYp2KX9PqOdMunQD+5uMHdy2324jWx69QGvF
xALL/xDnt+n3I3/H6xtJ41ck6LIWJWuMHB4A3TqKHPIL9S9nTeGqpVaWF20MF4kWxocsH
AfXg9UVpXN5L13/xfEQ5E5YrET9lDzbkkDuZeIGfTa3GQMsg+y9WyHTeiUW1vKjHlcM/o
zuedaP0cy+TVaiqfTOL4JrpQErxcFDtnvv3JUawZKJN/xJFyKzi/Cvvu+soolKKKtZWVZ
PSrUp7fMX8XepXi0JOQiVlMEKNebGnFx0vxcJuJ0R3O01CV+o+qA24G+rHh1P9pukZg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794953711;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
Received:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:Mime-Version:
Content-Transfer-Encoding:Content-Type:Date:Message-Id:Cc:Subject:
From:To:X-Mailer:References:In-Reply-To;
bh=8igbL3DrmgjB8f+3uFsYWHUjBeZpK0nAdLK0B3NxyZE=;
b=2XOnVakcoUQ8ClK/GO6WSMyZE5AAN2O1jaVErr05lqU2Q2yt44e62zAChzCUe8BspmA4
ge2HozUQPUBXSbSACDz5VBgBW32KD/E/DWlzTbBmJP1VNT9bJm/lZDUH9f4HuJPSYbJ1K
7QHo/lrjwzoMXLdkn/TsA5rlRyLSbJA+oKjYLDu1p2iAKXZTSkF7bwyVhhGZrAFMi4bOQ
SQeRK1ArGJR8VMj5xIGn7z4M5Qm1Va0iioJnfBtS8eU+6qZAGXGlBiwh5JPWkHBKYC2rq
xzcsup5sUaOFcR14ba+VRUKP80HWfaqPNn1YmYzaT8WX3EFhAcK+YQg5ei+yjJPto7Q==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=Omz6m5sE;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.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 924B6606A881;
Tue, 17 Nov 2026 22:15:11 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=Omz6m5sE
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.219.42
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1794953710;
b=jPm0wtp2CuhaApNr0uXctdXlGK1ApC8xo70sM37DB9yc/weEUX0ocJbk1t5bPXqAX5xo
6+J7h2TUokXI7F1NIQXRuYCPhaXKwyn7naGQgxJ8Si2JiFBApwArImGgNUE1EusuPRvYh
i4qJRmyuuktmBSbuLCoisZbZsHcFMDYKVJpSzboGEi/2YZZ52jhCqvMcpojZQ6I8hisy3
sO2TEY8nde6j1Ly3YEwWZVQxX+2jTk/jBYpitkQL2gN5g0cFoFUDiTBjUU1VwqTOSaTv9
Y4mbn955cuHppt7DJF5iyjpCSpm3jZqs9eJiwyOrEn/REe6VAb+L0t5jd5z66Wc+5vw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794953710;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Mime-Version:
Content-Transfer-Encoding:Content-Type:Date:Message-Id:Cc:Subject:
From:To:X-Mailer:References:In-Reply-To;
bh=8igbL3DrmgjB8f+3uFsYWHUjBeZpK0nAdLK0B3NxyZE=;
b=3uo5JHtWMiDYA9yRigJOmAyFZ80TN5upqyK1AIAimkoyp+fYBkMINdKtJhbaSKLxMwNo
GT8YzCTuVavCRdSclYZ4yJSSrIx9ThmDGj++qM0iGRQDouhmtkCboTIzlyxXJlGoqb/ig
xTwDVHcSTvElyY7ZD2R/wH0aRe9MENIg/CeKIhO2dZs4/0x29JpQgAc+BDGfzOk2LNRVL
ycrPhktzy5SxBnufGTE0iTCaVywngwQ3COCIuPuzjbYKQXYI8crVK7gPBd3Vf/L9A/5uc
6wQyslMhVmnu+NlZUbGIEzQ0YO9xOFiDMP9H8ITz2/6O15lho33qWxDeN4WSO051TtQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=Omz6m5sE;
arc=none smtp.remote-ip=209.85.219.42
X-Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42])
(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 68DDD606A32C
for <netdev@vger.kernel.org>; Tue, 17 Nov 2026 22:15:09 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 68DDD606A32C
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-91f2b826fe9so1968476d6.1
for <netdev@vger.kernel.org>; Tue, 17 Nov 2026 14:15:09 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1794953709; x=1795558509; darn=vger.kernel.org;
h=in-reply-to:references:to:from:subject:cc:message-id:date
:content-type:content-transfer-encoding:mime-version:from:to:cc
:subject:date:message-id:reply-to:content-type;
bh=8igbL3DrmgjB8f+3uFsYWHUjBeZpK0nAdLK0B3NxyZE=;
b=Omz6m5sEdcCo6i+rZhY1yYYjJkJ14J3/ehViGl2tfjKF8iKEXM6zW6OcK01d0pvglQ
/FyWYDd3s9dTK874m371PT9CPkHc8iiyhftD6T3ezaFb/DKKKdfmKq8+1bbBRWF2f59r
pPx0POo1MPsFAIzd4H2wfPc3JPhFi1cneOymArj+Nb7qd6SedaCUb+I0aF3LIjuWBWiC
0hhANseDZJJQl3514kujAp1eUbsyHKXvuoKsCflx/Akjgi0B/tlwc5X5HqqoixQSbJQe
qatcOfCVlvQrT6KKtTYaiM1cyk0aObDlkWtUfL4ACKut8n/uzQdXMiEHSkUPiEYiqVTv
sYjg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1794953709; x=1795558509;
h=in-reply-to:references:to:from:subject:cc:message-id:date
:content-type:content-transfer-encoding:mime-version:x-gm-gg
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=8igbL3DrmgjB8f+3uFsYWHUjBeZpK0nAdLK0B3NxyZE=;
b=PMG9PpP2zHAPSInwW+aueo2yVnl93oqDeGJFGopPRszx7sv809slgnErK8sf0DyHcf
a6GL35/vJa3kwfw943OfYhzSsQVLf7S3UOIXfM8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052e-55d5a5b77b2mr12272421cf.41.1794953708820;
Tue, 17 Nov 2026 14:15:08 -0800 (PST)
X-Received: from localhost ([2600:4040:9399:4000:e553:72e5:7d37:c7ef])
by smtp.gmail.com with ESMTPSA id 6a1803df08f44-92114d53b7fsm4789176d6.26.2026.11.17.14.15.07
(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
Tue, 17 Nov 2026 14:15:08 -0800 (PST)
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-Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>, "David
Decotigny" <decot@google.com>, "Madhu Chittim" <madhu.chittim@intel.com>,
"Emil Tantilov" <emil.s.tantilov@intel.com>, "Sridhar Samudrala"
<sridhar.samudrala@intel.com>, "Brian Vazquez" <brianvv@google.com>, "Li
Li" <boolli@google.com>, "Alexander Lobakin"
<aleksander.lobakin@intel.com>, "Daniel Zahka" <daniel.zahka@gmail.com>,
"Willem de Bruijn" <willemdebruijn.kernel@gmail.com>, "Kees Cook"
<kees@kernel.org>, "Gustavo A. R. Silva" <gustavoars@kernel.org>,
<linux-hardening@vger.kernel.org>
X-Mailer: aerc 0.21.0-threadmapfix
X-In-Reply-To: <20261117145522.1910636-10-stani@google.com>