Subject: [PATCH 1/1] STA_ASSOC: Mark Port authorization and State Completion based on authorized state in connect event

Vinayak Yadawad vinayak.yadawad at broadcom.com
Tue Jun 21 01:39:55 PDT 2022


Kindly ignore this patch request, as it has errors with indentation.
I will be sending a fresh email  request for the patch submission.

On Mon, Jun 20, 2022 at 12:18 PM Vinayak Yadawad
<vinayak.yadawad at broadcom.com> wrote:
>
> PFA  patch for reference generated using the git repo
>
> On Mon, Jun 20, 2022 at 11:26 AM Vinayak Yadawad
> <vinayak.yadawad at broadcom.com> wrote:
> >
> > In case of drivers supporting 4way handshake offload, mark port
> > authorized and state completion only if driver advertizes authorized
> > state in the connect event. Otherwise there are fair chances of driver
> > port authorization api gets called while 4-way handshake is in progress
> > at the lower layer.
> > In order to avoid this possible race condition always update port
> > authorization and supplicant state WPA_COMPLETED setting from
> > EVENT_PORT_AUTHORIZED context when driver is done with 4way handshake.
> >
> > Signed-off-by: Vinayak Yadawad <vinayak.yadawad at broadcom.com>
> > ---
> >  wpa_supplicant/events.c | 25 +++++++++++++++++--------
> >  1 file changed, 17 insertions(+), 8 deletions(-)
> >
> > diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
> > index ec56cfdc0..f20e1c87b 100644
> > --- a/wpa_supplicant/events.c
> > +++ b/wpa_supplicant/events.c
> > @@ -3478,14 +3478,23 @@ static void wpa_supplicant_event_assoc(struct
> > wpa_supplicant *wpa_s,
> >   eapol_sm_notify_eap_success(wpa_s->eapol, true);
> >   } else if ((wpa_s->drv_flags & WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK) &&
> >      wpa_key_mgmt_wpa_psk(wpa_s->key_mgmt)) {
> > - /*
> > - * We are done; the driver will take care of RSN 4-way
> > - * handshake.
> > - */
> > - wpa_supplicant_cancel_auth_timeout(wpa_s);
> > - wpa_supplicant_set_state(wpa_s, WPA_COMPLETED);
> > - eapol_sm_notify_portValid(wpa_s->eapol, true);
> > - eapol_sm_notify_eap_success(wpa_s->eapol, true);
> > + if (already_authorized) {
> > + /*
> > + * We are done; the driver will take care of RSN 4-way
> > + * handshake.
> > + */
> > + wpa_supplicant_cancel_auth_timeout(wpa_s);
> > + wpa_supplicant_set_state(wpa_s, WPA_COMPLETED);
> > + eapol_sm_notify_portValid(wpa_s->eapol, true);
> > + eapol_sm_notify_eap_success(wpa_s->eapol, true);
> > + } else {
> > + /* Update port, WPA_COMPLETED state from
> > + * EVENT_PORT_AUTHORIZED context when driver is done
> > + * with 4way handshake.
> > + */
> > + wpa_msg(wpa_s, MSG_INFO, "ASSOC INFO: wait for driver port "
> > + "authorized indication");
> > + }
> >   } else if ((wpa_s->drv_flags & WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X) &&
> >      wpa_key_mgmt_wpa_ieee8021x(wpa_s->key_mgmt)) {
> >   /*
> > --
> > 2.32.0

-- 
This electronic communication and the information and any files transmitted 
with it, or attached to it, are confidential and are intended solely for 
the use of the individual or entity to whom it is addressed and may contain 
information that is confidential, legally privileged, protected by privacy 
laws, or otherwise restricted from disclosure to anyone else. If you are 
not the intended recipient or the person responsible for delivering the 
e-mail to the intended recipient, you are hereby notified that any use, 
copying, distributing, dissemination, forwarding, printing, or copying of 
this e-mail is strictly prohibited. If you received this e-mail in error, 
please return the e-mail to the sender, delete it from your computer, and 
destroy any printed copy of it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4218 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.infradead.org/pipermail/hostap/attachments/20220621/4441b2c4/attachment.p7s>


More information about the Hostap mailing list