From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.160.182 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792494753; b=p5kGhVTCd5FvidvRzSOhPKHd+c9EmCYeBGnmPlJPpv8qXgUus81+l1F6t3mcmf+gxV5S xOjGrfObc01t2OFwu+hXeCchFBpYuqZmL7h5Km0smSFIfPM6zVmxLCo42mWnrZ9sJD4J9 b2sLY1em9HigFC3yc6P++m4rCFfjSaIJszr97Ov9p9eqa2YXaAibKBm0cdQIupCHeGL/o FppOwEViJCTs42jCWesTcFNouyMTbk3c90A5I+8d8JQalMdkJE2ufQXRuc8HQhUloGCfM NywgEPOq2n5/pV21zCAlGNlFSD4jaYaadRl8XpfBHuaPwKyTp72eNKnEKmhIEI5SGlg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792494753; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted: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=/wzsxSoyY0dwh32LBIY6rbjwv5tJyRh8dFNaQVlUF5E=; b=qrCt/edoc5mPhVPCC4z0CrFLDIosorOKdWOKS5R0mdEBk7xfWjJ/99YFmcRJ87YOygh6 o7Lx9rVpbs/y7RwOsvmnVegzsV84oTmH07xi/U7TwI3gGNRnds55ZJapextkQRn+7YYwN MO5Y6ZPjH4BEv+LOxfZhVq+MwnEsqRZ0obTNyOMe7sWNKiBIv1f/82JsXnLyF/n+Odt4c mGVBW4x4RmwXpy778PDlspT9kBo/0+FxyE+wA5Sc6WbNTphhKhF8PTr1CTdBVaxEeaSK0 KTGthcTeJWDHgh9pOg57fEMLdXtf2IwxAQUGgwoac7DKAsJU01gihqvkNb+Zgbm1m8g== 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=20251104 header.b=h0jHoV43; arc=none smtp.remote-ip=209.85.160.182 Received: from mail-qt1-f182.google.com (mail-qt1-f182.google.com [209.85.160.182]) (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 52002606A31B for ; Tue, 20 Oct 2026 11:12:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 52002606A31B Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=h0jHoV43 Received: by mail-qt1-f182.google.com with SMTP id d75a77b69052e-53669f7b518so18784761cf.2 for ; Tue, 20 Oct 2026 04:12:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1792494752; x=1793099552; 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=/wzsxSoyY0dwh32LBIY6rbjwv5tJyRh8dFNaQVlUF5E=; b=h0jHoV433gWa9Ypca1L4cXFH3c34IMnZgWaPNS7X+TIV6h4+W+S12MAgF6Tvk0SYlP n1kmEV4sCp+xT73ZfzJrgGeT73M4A5MaqybKiZ+u+HqwlUZ7QX2zumqRNDExqObyj07H 17ieLwtb6rk7j4UdSHfHIAB/ROJQqCUZF3Bxw90LZ5umHxZuPn+R487gL3e2nL3SgpbC zRHB+Yu8JFZiKxo+vO/GTgQV/DF4OTJ1oXwy2AZlwuphnc7dZiHAB80C1qFTsqJtvlMB 3/ff9aIIR7LayaXO4Tbt4+jR4fnUmgbo6vn0Rf1yIXGdKNz4AUACtQ0bEeGimbUnUnol pAxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792494752; x=1793099552; 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=/wzsxSoyY0dwh32LBIY6rbjwv5tJyRh8dFNaQVlUF5E=; b=BtMYKNMYQPDVnnhoEe4/tWuaA7Tk7/bqcH6jKlnL0kPMIgslKa+u+b3M2AcMq9Lb3z 4m9p6CAcrdClxiflTk/7MDm9Hi+ZEcbhZW9dq1eNQ/kvB4zrY9n8jxv1l3O1wcKE5DZ8 KLdu+VcycNTqLbtKwG4v4dN0Bb9RyNXWXcQCI4lDkBLDoYrBN0zGIWcTBaRfjxZHRyOj 4K8FSCyQ3E5Juow13DINJUS7kEWdxel6mvxmf6SEDCM/B6UCy3OrsuHS1c6lERvg8lgu 3GFGkGMieC4odx0bzrQgpJBDagfdbtSFN/oiHx+hVFk0mQvHZZbNNp2SkYZtfE7GJM2O Vy2Q== X-Forwarded-Encrypted: i=1; AKwUvBwLZyMqANH+OJaOuCpy+7bdelpzIahnVzvaqjmtk9QhipamudbzE4mdeQAuism0FBx1krMNvN+gUU4=@vger.kernel.org X-Gm-Message-State: AFq9FYJgECpql/0D8kanvPle/bD2y9b+Ax+pwvluGONqrN5ru/tV4BNJ tT0G2UaSWqfTiftbc7pe1JLdmwFOsxBSA0PEQBwAWHKUFyv1MfWzNyek X-Gm-Gg: AYBFou0UvQQtwKPGT5yQx2FIAYApYp3Ph2qGmP8XrSOhx/jpfoqnzHEMYPbA+1WUcba VRvXJ2x9DC/ZQ6nFm9aNAI5tTeZsJjCWUG2iHmfZAdy2JFJ0p404EfIJqUUuwaLPnOg0MDf4erE AC5hjONEUnJTMqvdQSKm69zqE5EXH05fG+C+s6675zHfLXdLiW0ArKLEEx+CkRUtFh+hok72luJ lsgwGkpyd0e+xksqvL4+CfISF0MgsShdE2vZi7szNxBZE7iCgDlsMJ0rTq2gBUhv5NmPSmwR0f/ AnkspardcGeVM/Z04JdpAzsA+COdMn0o6JuS3p/LMP1rHF+qGM753mw+i/NiwUWvm8mf0OcFxrL /g8Sv2oynzDnXqbYKnjbT4YT54+gG1I4SaOffGp3l8vJtg3Pm9i4eQmEWdO35e3/FxGvDMP8xMH htcjbk5kK1gADiXrX+3BN8XVpUr7GdcSAsSvl4BN1hi+UHIweQ3bcjRvq1gGgvTIKBcABu+N5qC bw= X-Received: by 2002:a05:622a:5514:b0:536:52ae:d92f with SMTP id d75a77b69052e-53652aee3e4mr127981451cf.32.1792494752169; Tue, 20 Oct 2026 04:12:32 -0700 (PDT) Received: from localhost ([2600:4040:9399:4000:e553:72e5:7d37:c7ef]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-536448b6ce6sm96882821cf.28.2026.10.20.04.12.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Oct 2026 04:12:31 -0700 (PDT) X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 20 Oct 2026 07:12:30 -0400 Message-Id: Cc: , , , Subject: Re: [PATCH net-next v2 0/7] psp: support rekeying psp protected tcp connections From: "Daniel Zahka" To: "Daniel Zahka" , "Jakub Kicinski" , "Willem de Bruijn" , "David S. Miller" , "Eric Dumazet" , "Paolo Abeni" , "Simon Horman" , "Jonathan Corbet" , "Shuah Khan" , "Randy Dunlap" , "Donald Hunter" , "Andrew Lunn" , "Shuah Khan" X-Mailer: aerc 0.21.0-threadmapfix References: <20261009-psp-v2-0-5596ab50f677@gmail.com> In-Reply-To: <20261009-psp-v2-0-5596ab50f677@gmail.com> On Fri Oct 9, 2026 at 4:46 PM EDT, Daniel Zahka wrote: > The PSP architecture spec states the need for rekeying connections in > the event of a device key rotation. After a device key rotation has > occurred, a new rx derived key needs to be generated and sent out to the > other end of the connection sometime before the next device key rotation > occurs. > > Because PSP connections involve two different keys at each endpoint, > one for decrypting ingress traffic, and one for encrypting egress > traffic, there are two types of rekeying events that need to be > supported. From the perspective of one endpoint of the connection: > > 1. rx rekey: we need to allocate a new spi + decryption key pair to > provide to our peer. > > 2. tx rekey: our peer has provided us with a new spi + encryption key > pair which we should use for encrypting traffic immediately. > > In the case of rx rekeying, there is a period where it makes sense to > accept packets authenticated from either the previous or current spi. To > deal with that, we allow a psp_assoc to remember the last spi that was > valid on a socket due to a rekey. If authentication state does not match > the most recent assoc, the stored state from the previous assoc will be > tried. > > In the case of tx rekeying, as soon as we install the new tx key, we > have no use for the previous one, and it can be disposed of immediately. > The only catch is in the case where hw uses a key handle in tx > descriptor state, as opposed to inlining the key directly. In this > case, psp core needs to be sure that any of these unaccounted for > references to key state are gone by the time it tries to sync a deleted > key to hw. > > To deal with this race condition, we introduce a different path to key > deletion for psp_assocs removed from the socket during a tx rekey. psp > core will use bql byte counters filled out by the driver to determine a > conservative grace period where key handles can be disposed of. > > Lastly, some test cases for rekeying are included that go through key > rotations and rekeying. > > There are some packetdrill tests that are queued for upstreaming [1]. > > [1]: https://github.com/danieldzahka/packetdrill/commits/psp-rekey/ > > Signed-off-by: Daniel Zahka pw-bot: cr Sorry, I should have tagged this myself for clarity. I'm planning to send a v3 when net-next reopens to address some of the low level complaints, as well as a CI issue introduced by the rekey drain test.