Re: [PATCH] netdev: destroy auth-proto after external auth

KeithG <[email protected]>
Newsgroups dev.linux.lists.iwd
Message-ID <CAG17S_P=O9P1EKFZk939SNQWA6-Q4dePvrrecBwHLXw6VBRKXA@mail.gmail.com>
On Thu, Dec 19, 2024 at 12:18 PM James Prestwood <[email protected]> wrote:
>
> Hi Keith,
>
> On 12/19/24 10:17 AM, James Prestwood wrote:
> > With external auth there is no associate event meaning the auth proto
> > never gets freed, which prevents eapol from starting inside the
> > OCI callback. Check for this specific case and free the auth proto
> > after signaling that external auth has completed.
> > ---
> >   src/netdev.c | 7 +++++++
> >   1 file changed, 7 insertions(+)
> >
> > diff --git a/src/netdev.c b/src/netdev.c
> > index 02496c92..2a6d94fc 100644
> > --- a/src/netdev.c
> > +++ b/src/netdev.c
> > @@ -3483,6 +3483,13 @@ static void netdev_external_auth_sae_tx_associate(void *user_data)
> >
> >       netdev_send_external_auth(netdev, MMPDU_STATUS_CODE_SUCCESS);
> >       netdev_ensure_eapol_registered(netdev);
> > +
> > +     /*
> > +      * Free the auth proto now. With external auth there is no associate
> > +      * event which is where this normally gets cleaned up.
> > +      */
> > +     auth_proto_free(netdev->ap);
> > +     netdev->ap = NULL;
> >   }
> >
> >   struct rtnl_data {
>
> Could you give this version of the patch a try to verify it still works
> on brcmfmac? This is just a bit simpler and more straight forward.
>
> Thanks,
>
> James
>
James,

This patch seems to work just like the previous one. I am able to get
a connection, collect a DHCP address and then ping the AP from the
RPi.

I use connman/iwd

Dec 19 21:49:45 jackrune iwd[346]: event: connect-info, FullMAC
driver: brcmfmac using SAE.  Expect EXTERNAL_AUTH
Dec 19 21:49:47 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd022 fail, reason -52
Dec 19 21:49:47 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd026 fail, reason -52
Dec 19 21:49:47 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd02a fail, reason -52
Dec 19 21:49:47 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd02e fail, reason -52
Dec 19 21:49:48 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd034 fail, reason -52
Dec 19 21:49:48 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd038 fail, reason -52
Dec 19 21:49:48 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd03c fail, reason -52
Dec 19 21:49:48 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd040 fail, reason -52
Dec 19 21:49:48 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd064 fail, reason -52
Dec 19 21:49:48 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd068 fail, reason -52
Dec 19 21:49:48 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd06c fail, reason -52
Dec 19 21:49:48 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd070 fail, reason -52
Dec 19 21:49:48 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd074 fail, reason -52
Dec 19 21:49:48 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd078 fail, reason -52
Dec 19 21:49:48 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd07c fail, reason -52
Dec 19 21:49:48 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd080 fail, reason -52
Dec 19 21:49:48 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd084 fail, reason -52
Dec 19 21:49:48 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd088 fail, reason -52
Dec 19 21:49:48 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd08c fail, reason -52
Dec 19 21:49:48 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd090 fail, reason -52
Dec 19 21:49:48 jackrune iwd[346]: event: connect-info, FullMAC
driver: brcmfmac using SAE.  Expect EXTERNAL_AUTH
Dec 19 21:49:49 jackrune connmand[454]: Adding configuration wifi_6465736b534145
Dec 19 21:49:49 jackrune connmand[454]: Adding service configuration
6465736b534145
Dec 19 21:49:49 jackrune connmand[454]: Interface wlan0 [ wifi ] state
is association
Dec 19 21:49:49 jackrune connmand[454]: ipconfig state 2 ipconfig method 1
Dec 19 21:49:49 jackrune iwd[346]: event: connect-info, FullMAC
driver: brcmfmac using SAE.  Expect EXTERNAL_AUTH
Dec 19 21:49:49 jackrune iwd[346]: event: connect-info, FullMAC
driver: brcmfmac using SAE.  Expect EXTERNAL_AUTH
Dec 19 21:49:49 jackrune iwd[346]: event: connect-info, FullMAC
driver: brcmfmac using SAE.  Expect EXTERNAL_AUTH
Dec 19 21:49:49 jackrune iwd[346]: event: connect-info, ssid: deskSAE,
bss: d8:3a:dd:60:a3:0c, signal: -58, load: 0/255
Dec 19 21:49:49 jackrune iwd[346]: event: state, old:
autoconnect_full, new: connecting
Dec 19 21:49:49 jackrune connmand[454]: Interface wlan0 [ wifi ] state
is configuration
Dec 19 21:49:49 jackrune connmand[454]: ipconfig state 3 ipconfig method 1
Dec 19 21:49:49 jackrune iwd[346]: event: connect-info, External Auth
to SSID: deskSAE, bssid: d8:3a:dd:60:a3:0c
Dec 19 21:49:49 jackrune connmand[454]: wlan0 {RX} 1 packets 121 bytes
Dec 19 21:49:49 jackrune connmand[454]: wlan0 {TX} 0 packets 0 bytes
Dec 19 21:49:49 jackrune connmand[454]: wlan0 {update} flags 69635 <UP,LOWER_UP>
Dec 19 21:49:48 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd074 fail, reason -52
Dec 19 21:49:48 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd078 fail, reason -52
Dec 19 21:49:48 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd07c fail, reason -52
Dec 19 21:49:48 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd080 fail, reason -52
Dec 19 21:49:48 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd084 fail, reason -52
Dec 19 21:49:48 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd088 fail, reason -52
Dec 19 21:49:48 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd08c fail, reason -52
Dec 19 21:49:48 jackrune kernel: brcmfmac: brcmf_set_channel: set
chanspec 0xd090 fail, reason -52
Dec 19 21:49:48 jackrune iwd[346]: event: connect-info, FullMAC
driver: brcmfmac using SAE.  Expect EXTERNAL_AUTH
Dec 19 21:49:49 jackrune connmand[454]: Adding configuration wifi_6465736b534145
Dec 19 21:49:49 jackrune connmand[454]: Adding service configuration
6465736b534145
Dec 19 21:49:49 jackrune connmand[454]: Interface wlan0 [ wifi ] state
is association
Dec 19 21:49:49 jackrune connmand[454]: ipconfig state 2 ipconfig method 1
Dec 19 21:49:49 jackrune iwd[346]: event: connect-info, FullMAC
driver: brcmfmac using SAE.  Expect EXTERNAL_AUTH
Dec 19 21:49:49 jackrune iwd[346]: event: connect-info, FullMAC
driver: brcmfmac using SAE.  Expect EXTERNAL_AUTH
Dec 19 21:49:49 jackrune iwd[346]: event: connect-info, FullMAC
driver: brcmfmac using SAE.  Expect EXTERNAL_AUTH
Dec 19 21:49:49 jackrune iwd[346]: event: connect-info, ssid: deskSAE,
bss: d8:3a:dd:60:a3:0c, signal: -58, load: 0/255
Dec 19 21:49:49 jackrune iwd[346]: event: state, old:
autoconnect_full, new: connecting
Dec 19 21:49:49 jackrune connmand[454]: Interface wlan0 [ wifi ] state
is configuration
Dec 19 21:49:49 jackrune connmand[454]: ipconfig state 3 ipconfig method 1
Dec 19 21:49:49 jackrune iwd[346]: event: connect-info, External Auth
to SSID: deskSAE, bssid: d8:3a:dd:60:a3:0c
Dec 19 21:49:49 jackrune connmand[454]: wlan0 {RX} 1 packets 121 bytes
Dec 19 21:49:49 jackrune connmand[454]: wlan0 {TX} 0 packets 0 bytes
Dec 19 21:49:49 jackrune connmand[454]: wlan0 {update} flags 69635 <UP,LOWER_UP>
Dec 19 21:49:49 jackrune connmand[454]: wlan0 {newlink} index 3
address B8:27:EB:A4:6E:0F mtu 1500
Dec 19 21:49:49 jackrune connmand[454]: wlan0 {newlink} index 3
operstate 5 <DORMANT>
Dec 19 21:49:49 jackrune systemd-networkd[163]: wlan0: Connected WiFi
access point: deskSAE (d8:3a:dd:60:a3:0c)
Dec 19 21:49:49 jackrune iwd[346]: hardware_rekey not supported
Dec 19 21:49:49 jackrune iwd[346]: event: state, old: connecting, new:
connecting (netconfig)
Dec 19 21:49:49 jackrune systemd-networkd[163]: wlan0: Gained carrier
Dec 19 21:49:49 jackrune connmand[454]: wlan0 {RX} 3 packets 356 bytes
Dec 19 21:49:49 jackrune connmand[454]: wlan0 {TX} 4 packets 652 bytes
Dec 19 21:49:49 jackrune connmand[454]: wlan0 {update} flags 69699
<UP,RUNNING,LOWER_UP>
Dec 19 21:49:49 jackrune connmand[454]: wlan0 {newlink} index 3
address B8:27:EB:A4:6E:0F mtu 1500
Dec 19 21:49:49 jackrune connmand[454]: wlan0 {newlink} index 3 operstate 6 <UP>
Dec 19 21:49:50 jackrune systemd-networkd[163]: wlan0: Gained IPv6LL
Dec 19 21:49:52 jackrune iwd[346]: event: state, old: connecting
(netconfig), new: connected
Dec 19 21:49:52 jackrune systemd-resolved[316]: wlan0: Bus client set
DNS server list to: 192.168.5.1
Dec 19 21:49:52 jackrune connmand[454]: wlan0 {add} address
192.168.5.207/24 label wlan0 family 2
Dec 19 21:49:53 jackrune kernel: sh (18913): drop_caches: 3
Dec 19 21:49:54 jackrune connmand[454]: rp_filter set to 2 (loose mode
routing), old value was 0
Dec 19 21:49:54 jackrune connmand[454]: Interface wlan0 [ wifi ] state is ready

# ping 192.168.5.1
PING 192.168.5.1 (192.168.5.1) 56(84) bytes of data.
64 bytes from 192.168.5.1: icmp_seq=1 ttl=64 time=26.7 ms
64 bytes from 192.168.5.1: icmp_seq=2 ttl=64 time=4.79 ms
64 bytes from 192.168.5.1: icmp_seq=3 ttl=64 time=4.39 ms
64 bytes from 192.168.5.1: icmp_seq=4 ttl=64 time=4.42 ms

# ifconfig wlan0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.5.207  netmask 255.255.255.0  broadcast 192.168.5.255
        ether b8:27:eb:a4:6e:0f  txqueuelen 1000  (Ethernet)
        RX packets 15  bytes 2718 (2.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 32  bytes 4668 (4.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.