Package: wpasupplicant
Version: 2:2.10-24
Severity: normal
X-Debbugs-Cc: [email protected]

Hi Andrej,

tl;dr: There's an (unlikeley) race in wpa_supplicant<>ifupdown integration.

Currently we start wpa_supplicnat in the "pre-up" PHASE when the interface
is still administratively DOWN (~IFF_UP).

Since wpa_supplicant takes control of UP'ing (IFF_UP) the interface
(cf. i802_set_iface_flags(bss, 1) in wpa_driver_nl80211_finish_drv_init())
delays in other pre-up scripts can race with ifup setting various ipv6
sysctls that need to be initialised *before* the interface actually comes
UP (IFF_RUNNING).

See attached test-ifupdown-race.sh for details. I needed to run it with a
RACE_WINDOW of 6 seconds in my setup to get the race/bug to trigger.

Looking at debian/ifupdown/wpasupplicant/ifupdown.sh, init_wpa_supplicant
seems to be what kicks things off:

    case "$MODE" in 
        start)
            do_start
            case "$PHASE" in
                pre-up)
                    kill_wpa_supplicant
                    init_wpa_supplicant     || exit 1
                    conf_wpa_supplicant     || { kill_wpa_supplicant; exit 1; }
                    ;;

I believe we should change this to be run at `up` instead.

--Daniel

Attachment: test-ifupdown-race.sh
Description: Bourne shell script

Attachment: signature.asc
Description: PGP signature

Reply via email to