public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Sai Pratyusha Magam <sai.magam@oss.qualcomm.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org, Rohan Dutta <quic_drohan@quicinc.com>
Subject: Re: [PATCH wireless-next] wifi: mac80211: Fix AAD/Nonce computation for management frames with MLO
Date: Fri, 23 Jan 2026 17:08:30 +0530	[thread overview]
Message-ID: <215985b3-e951-415e-b091-3306fa08036c@oss.qualcomm.com> (raw)
In-Reply-To: <d0798e0f62405687c57eff59767ac77b25c1f330.camel@sipsolutions.net>



On 1/14/2026 10:34 PM, Johannes Berg wrote:
> On Fri, 2026-01-09 at 15:33 +0530, Sai Pratyusha Magam wrote:
>>
>> Hi Johannes, I agree that by maintaining a local storage of the A1/A2/A3
>> link addresses before mac80211 translates them to the MLD addresses
>> would make things easy, i.e, they can directly be used for the
>> computations in the SW crypto. While this works well for the receive
>> path, on the Transmit path, mac80211 would still receive management
>> frames from hostapd with the MLD addresses, which again cannot be used
>> directly for the AAD/Nonce computations.
> 
> Fair point.
> 
> Thinking out loud: First, I think we can afford to separate TX and RX
> discussions.
> 
> For RX, I think we agree that it could be done much simpler by
> (conditionally, when we do translation in mac80211) keeping the pre-
> translation addresses, and passing them into the SW crypto. If not set,
> use the frame itself.
Agree that on the RX, crypto computations can use the copy of 
untranslated storage of addresses

> 
> Secondly, this all seems only relevant to hwsim. Do you think otherwise?
> Few drivers seem to use IEEE80211_KEY_FLAG_SW_MGMT_TX, so I think
> especially with MLO we can say that you simply _have_ to support TX
> encryption offload for EPPKE [1].
>
True, all of this is for the hwsim use case that uses the mac80211 based 
software crypto.


> Obviously we still want to have hwsim, but if this really is only for
> that then I feel we can still fairly easily implement TX encryption
> "offload"? After all, in RX we make decryption optional for every single
> frame - so if the device/driver didn't decrypt/validate the frame then
> mac80211 will. We also pass the key to the driver for each individual
> packet (struct ieee80211_tx_info::control::key). So doing the encryption
> in hwsim would be really simple if we export a function akin to
> ieee80211_tx_h_encrypt() that works on a single skb (which has the key
> pointer), sets up a single-frame struct ieee80211_tx_data and returns
> the skb from that [2].
>
"Implement TX encryption offload" - As I understand, your guidance is
towards implementing the Tx encryption in the mac80211_hwsim driver
Can you please kindly clarify if the understanding is correct?
In order to let mac80211_hwsim driver do the Tx encryption:
(1)Add support for key install to hwsim driver, i.e, 
mac80211_hwsim_ops::add_key, so mac80211 knows that the driver is going 
to do the encryption.
(2)A function similar to ieee80211_tx_h_encrypt() in the hwsim driver
that can do the actual encryption. Since mgmt frames need to use link 
addresses for crypto computations, possibly I could call 
ieee80211_encrypt_tx_skb() [2] after address translation to link 
addresses in mac80211_hwsim_tx() and since data frames need to use the 
MLD addresses, ieee80211_encrypt_tx_skb() can be called before the 
address translation to link addresses.


> While this may sound like a bit more work overall, I'm not even
> convinced that it's _that_ much more, and I it would also align hwsim
> more with how modern hardware works today anyway.
> 
> Any thoughts?
> 
> johannes
> 
> [1] and, it seems, correct unicast action frame encryption?
> [2] https://p.sipsolutions.net/154c5c86af7765fd.txt


  reply	other threads:[~2026-01-23 11:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-11 12:36 [PATCH wireless-next] wifi: mac80211: Fix AAD/Nonce computation for management frames with MLO Sai Pratyusha Magam
2026-01-08 12:52 ` Johannes Berg
2026-01-09 10:03   ` Sai Pratyusha Magam
2026-01-14 17:04     ` Johannes Berg
2026-01-23 11:38       ` Sai Pratyusha Magam [this message]
2026-01-23 12:34         ` Johannes Berg
2026-02-02  5:40           ` Sai Pratyusha Magam

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=215985b3-e951-415e-b091-3306fa08036c@oss.qualcomm.com \
    --to=sai.magam@oss.qualcomm.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=quic_drohan@quicinc.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