Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: andcov23@gmail.com
Cc: linux-wireless@vger.kernel.org,
	Kavita Kavita <kavita.kavita@oss.qualcomm.com>,
	Sai Pratyusha Magam <sai.magam@oss.qualcomm.com>
Subject: Re: [PATCH] wifi: mac80211: defer AP-side FT key upload until association
Date: Thu, 30 Jul 2026 18:21:19 +0200	[thread overview]
Message-ID: <1dceded216618b1d7bb7b79846f15712161f2cc8.camel@sipsolutions.net> (raw)
In-Reply-To: <20260730161531.3535100-1-andcov23@gmail.com> (sfid-20260730_181613_060012_A4F8F4A1)

On Thu, 2026-07-30 at 18:14 +0200, andcov23@gmail.com wrote:
> From: Andrea Covelli <andcov23@gmail.com>
> 
> During an AP-side Fast Transition, hostapd may install the PTK after
> creating a station entry but before marking it associated. The ASSOC gate
> in ieee80211_add_key() rejects the request with -ENOENT, producing:
> 
>   nl80211: kernel reports: key addition failed
> 
> Userspace may retry after association, but this race can instead break
> the roam, particularly with PMF.
> 
> Accept pre-association pairwise keys on AP and AP_VLAN interfaces once
> the station exists. Mark only those keys as deferred so hardware upload
> is skipped while the key is stored in mac80211. Upload the marked PTKs
> after the driver's AUTH-to-ASSOC state transition succeeds.
> 
> Track deferred state on each key and scan the station's PTK slots at
> ASSOC so hardware upload is limited to keys accepted before association.
> EPP peers are excluded from this deferral because EPP requires the PTK
> to be available before association to encrypt and decrypt
> (Re)Association Request and Response frames.
> 
> Fixes: 1626e0fa740d ("mac80211: fix FT roaming")

This is _ages_ ago, so this bug has been around basically forever.

> Cc: stable@vger.kernel.org

I don't think the stable thing is appropriate then.

I also have a very large set of changes in this area that actually end
up doing something very similar for SMD Transition, and much more
comprehensively, which I'm about to post, so I think it's better for
this to be integrated with that work later.

This also doesn't consider the case of failure on HW support, i.e. with
SW_CRYPTO_CONTROL it just (without any comment I might add) skips the
thing by pretending the driver said it was OK. Not convinced that's a
good idea, although this might be something that can't really solved
better, perhaps.

johannes

  reply	other threads:[~2026-07-30 16:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-30 16:14 [PATCH] wifi: mac80211: defer AP-side FT key upload until association andcov23
2026-07-30 16:21 ` Johannes Berg [this message]
2026-07-30 17:00   ` Andrea Covelli
2026-07-30 18:54     ` Johannes Berg
2026-08-03 22:30       ` Andrea Covelli

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=1dceded216618b1d7bb7b79846f15712161f2cc8.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=andcov23@gmail.com \
    --cc=kavita.kavita@oss.qualcomm.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=sai.magam@oss.qualcomm.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