From: Jakub Kicinski <kuba@kernel.org>
To: Sabrina Dubroca <sd@queasysnail.net>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
Boris Pismenny <borisp@nvidia.com>,
Eric Dumazet <edumazet@google.com>,
John Fastabend <john.fastabend@gmail.com>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
Tariq Toukan <ttoukan.linux@gmail.com>
Subject: Re: [PATCH net-next] tls: don't reset prot->aad_size and prot->tail_size for TLS_HW
Date: Fri, 20 Oct 2023 17:14:48 -0700 [thread overview]
Message-ID: <20231020171448.484dcf2a@kernel.org> (raw)
In-Reply-To: <979d2f89a6a994d5bb49cae49a80be54150d094d.1697653889.git.sd@queasysnail.net>
On Fri, 20 Oct 2023 16:00:55 +0200 Sabrina Dubroca wrote:
> Prior to commit 1a074f7618e8 ("tls: also use init_prot_info in
> tls_set_device_offload"), setting TLS_HW on TX didn't touch
> prot->aad_size and prot->tail_size. They are set to 0 during context
> allocation (tls_prot_info is embedded in tls_context, kzalloc'd by
> tls_ctx_create).
>
> When the RX key is configured, tls_set_sw_offload is called (for both
> TLS_SW and TLS_HW). If the TX key is configured in TLS_HW mode after
> the RX key has been installed, init_prot_info will now overwrite the
> correct values of aad_size and tail_size, breaking SW decryption and
> causing -EBADMSG errors to be returned to userspace.
>
> Since TLS_HW doesn't use aad_size and tail_size at all (for TLS1.2,
> tail_size is always 0, and aad_size is equal to TLS_HEADER_SIZE +
> rec_seq_size), we can simply drop this hunk.
>
> Fixes: 1a074f7618e8 ("tls: also use init_prot_info in tls_set_device_offload")
> Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
> ---
> Tariq, does that solve the problem you reported in
> https://lore.kernel.org/netdev/3ace1e75-c0a5-4473-848d-91f9ac0a8f9c@gmail.com/
> ?
In case Tariq replies before Monday and DaveM wants to take it, LGTM:
Acked-by: Jakub Kicinski <kuba@kernel.org>
next prev parent reply other threads:[~2023-10-21 0:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-20 14:00 [PATCH net-next] tls: don't reset prot->aad_size and prot->tail_size for TLS_HW Sabrina Dubroca
2023-10-21 0:14 ` Jakub Kicinski [this message]
2023-10-22 12:02 ` Tariq Toukan
2023-10-22 14:07 ` Tariq Toukan
2023-10-23 17:20 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231020171448.484dcf2a@kernel.org \
--to=kuba@kernel.org \
--cc=borisp@nvidia.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sd@queasysnail.net \
--cc=ttoukan.linux@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).