From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.216.99 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796428612; b=BOFca4qOar3X8PpSCBgKgEtHYEFbmHK2Q/9MTNjlRjYPgGnlaprvYplnRijQlL0+VmUe PC8LQoxzODcsEYf32afQwRcIr7EZGQeQCqFRsKYt7pursTgdmHy1pNFjTePHtvwbXpofY 0VC7qifp7AtaoqyuPGrKZEyNRamFdHOdpC1alS8/ZQ+TgHvJUXr8fyYYkujMzmA1P3GwI pbb9lO5wVwhDQ85kBule17E1USzul3rHr6Wsr1qFNN95CcAs5+FWPCSHEnYQYguetD/uA bf1Voqo5dLTGPKKz/WWYuARONDFzrSHRUIt7KjOueQV9Jzw42MkAWBixbBNZ7V6wr6A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796428612; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:X-Relaying-Domain: Received:Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=sa0eWLCUgRB/laHzy537c7gZNelCVbIKlV7ie7XWDtk=; b=UUGOqQbmPfp9OzxeEJCmv8ZXyfZDOekzs42UjWfGSAq66+ao0d5Xfj2VXCrJ+SDy+6wl Kq03y5yMLMEZjcnm9q5W4c3+PFAyj49YgWINioYyK64xfL/hN5rEQ/ypMv2NIk3eiDIz0 FNM6EG2ehXA23OxkvGxNkIqz0m+V2D9L3E6RV/njE28CpYaoylIvHFEayuzz874L2MD7b WXwhGbzxqKPvcYm3aG1jc1y1DK6Dh/W+T+mhyFHWNdYmee16G3Ay1PllQ5PS3d5kjCC4A mMf39p9cZ4Wq18F6K68PSdGjzF1mpPHr9jas9C38r8KpynQp3zYjUiZ3L5RgK9mXaxA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=purestorage.com; spf=pass smtp.mailfrom=purestorage.com; dkim=pass header.d=purestorage.com header.i=@purestorage.com header.a=rsa-sha256 header.s=google2022 header.b=G+a4RHrA; arc=none smtp.remote-ip=209.85.216.99 Received: from mail-pj1-f99.google.com (mail-pj1-f99.google.com [209.85.216.99]) (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 EC5E4606A683 for ; Fri, 4 Dec 2026 23:56:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org EC5E4606A683 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=purestorage.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=purestorage.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.a=rsa-sha256 header.s=google2022 header.b=G+a4RHrA Received: by mail-pj1-f99.google.com with SMTP id 98e67ed59e1d1-3b59bcb3301so1487363a91.0 for ; Fri, 04 Dec 2026 15:56:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1796428611; x=1797033411; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=sa0eWLCUgRB/laHzy537c7gZNelCVbIKlV7ie7XWDtk=; b=G+a4RHrARRuv+VTSt+1emdt/94gdyhTUGdhpzTz/SdKBo+lRQzW9TgWjKXI2VIVRey ErKlS2ysKK3P2fx9Tfh6dWNc5ouN7mxaBN/dnvGGCC9RIksovfViLPnD0UViF9UqI2b9 XmNS1t90A9AleNx/q5HiGgbqiJH9sIeADhK+gxphiGwVokyv3aQ6VIRPq2wxPURH9vCO 35pYsI0WhUuVBqkHiTI/pefyJFBC08ra31JrjX0WOtvF1bNd+qi59G2BeKcCWf5j/1g8 7Zgaa4Bjayco8/o+orqi0U+nzYPm3g76+bJKdCV7fFhtbZqmuPlIIpd7Y7oUxAQ5VK3n 9i9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796428611; x=1797033411; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=sa0eWLCUgRB/laHzy537c7gZNelCVbIKlV7ie7XWDtk=; b=Yqn0GhLjDThgwix+bmAdHeImUFXshUwY4P+n8wqfJoNTCiWCyVzfG/isq5kzhOIK+r cOjO2kIYtfmz6S7Tlh3+SUNbr/In5SScm9vbnmoD1Z5gFVP5RiKT0RJQk9cE6c+y9yq+ 54G5YJvkokg5SiWYFz7RlnOxVp9VGW9NCzwZVj6loYoN/VG+rc1FCvbS18Mkm5qx5Utj r14d+Cus7XHJMCdV/Y74+dHZtpuARAiyDnOZz7kJxc+t8jktXIcCzk6d0AE/RLggV2i8 ZsyeJfhEjf+hg4ERMowAG7u3sJzhkYrJ4eB+YWmD9mS9QsZZW/hRpLZ0p3jOfINbwkB7 PDMQ== X-Gm-Message-State: AB4q+uFPww++k8jM+hUaYL2HDOiGKJTpel2Ya9ziPEIjKjyv8QbPBAvg LpKv0FDw/r99fyHoYY0i8iEhcNNm0e8Qg4GuRIIOQ60RxYsmr7r7V2k6B0fl88mD6PxxZdnpgxi 6tn8iDCPrwboxyqpch3AwLeSNHK5A1XekCOSY X-Gm-Gg: AZFdTZfbHguS4W1eDbU4Qqei3mSLkMQCQc1yWXK1hwC0ighiLff7nXG64vBveG9Q0lX jKlXw2eIiXxD5fwjQs0jAJV7SdgiQP9GPcdnFBCXrN+kX3iZuZL6EebtWh2LKsNwc5RbPxL7uvy eCVTuDpsbNG4UqQOXJLAtZZ2+2j5aUPVn+IkZaPoIsl9f5QUeKaLyl0NYrXfL2b9IYOB9fL74A4 ENMaeg1lG/KCYsKwG5i4mQTHlwKBoJOt+V2VBHa9Qh+pPV5DCGp1E8yPc+wNHH5wMU3N8pG46AL eB2ZKS32mMwkTxiyvvmrK232TQol5koWvUJ6T6aEkfVfQgvzQm8bVXjzdV48vJo/pWY4vBdd0+n Zi28KrS2HGsQEAwc66/VfiXmpbPmODFdYCWY= X-Received: by 2002:a17:90b:5848:b0:3b5:dd3e:9299 with SMTP id 98e67ed59e1d1-3b5e06194c4mr2109563a91.10.1796428611108; Fri, 04 Dec 2026 15:56:51 -0800 (PST) Received: from c7-smtp-2026.dev.purestorage.com ([208.88.159.129]) by smtp-relay.gmail.com with ESMTPS id 98e67ed59e1d1-3b6168eb918sm176553a91.3.2026.12.04.15.56.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 15:56:51 -0800 (PST) X-Relaying-Domain: purestorage.com Received: from dev-rjethwani.dev.purestorage.com (dev-rjethwani.dev.purestorage.com [10.17.2.234]) by c7-smtp-2026.dev.purestorage.com (Postfix) with ESMTP id 3891F400F2; Fri, 4 Dec 2026 16:56:50 -0700 (MST) Received: by dev-rjethwani.dev.purestorage.com (Postfix, from userid 1557719937) id 35BDCDCE140; Fri, 4 Dec 2026 16:56:50 -0700 (MST) From: Rishikesh Jethwani To: netdev@vger.kernel.org Cc: Rishikesh Jethwani , stable@vger.kernel.org, John Fastabend , Jakub Kicinski , Sabrina Dubroca , "David S. Miller" , Eric Dumazet , Paolo Abeni , Willem de Bruijn , Simon Horman , Ilya Lesokhin , Aviad Yehezkel , Boris Pismenny Subject: [PATCH net v3 3/9] tls: device: don't let the NIC encrypt fallback output again Date: Fri, 4 Dec 2026 16:53:50 -0700 Message-ID: <20261204235642.36653-4-rjethwani@purestorage.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20261204235642.36653-1-rjethwani@purestorage.com> References: <20261204235642.36653-1-rjethwani@purestorage.com> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Software fallback output still belongs to the offloaded socket. A driver that checks only the socket can therefore encrypt ciphertext again, exposing plaintext. Require skb_is_decrypted() in tls_is_skb_tx_device_offloaded(). Fallback output then takes the ordinary TX path, as does data queued before TLS_TX was enabled. Backport the first three fixes together, in order. Found by manual inspection. On two mlx5 hosts with TLS 1.2 AES-GCM-128, the macvlan reroute test returned a mismatched echo without the fix and passed with it. The other drivers were checked by inspection only. Fixes: e8f69799810c ("net/tls: Add generic NIC offload infrastructure") Cc: stable@vger.kernel.org Signed-off-by: Rishikesh Jethwani --- include/net/tls.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/net/tls.h b/include/net/tls.h index 0b001b8ab1c3..9998b5582091 100644 --- a/include/net/tls.h +++ b/include/net/tls.h @@ -365,7 +365,8 @@ static inline bool tls_is_skb_tx_device_offloaded(const struct sk_buff *skb) return sk && sk_fullsock(sk) && (smp_load_acquire(&sk->sk_validate_xmit_skb) == - &tls_validate_xmit_skb); + &tls_validate_xmit_skb) && + skb_is_decrypted(skb); #else return false; #endif -- 2.50.1