Activity log for bug #1776491

Date Who What changed Old value New value Message
2018-06-12 14:17:09 Paolo Pisati bug added bug
2018-06-12 14:17:29 Paolo Pisati attachment added 0001-SAUCE-wcn36xx-read-MAC-from-file-or-randomly-generat.patch https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1776491/+attachment/5151767/+files/0001-SAUCE-wcn36xx-read-MAC-from-file-or-randomly-generat.patch
2018-06-12 14:27:15 Paolo Pisati description Impact: The wcn36xx driver in Xenial/linux-snapdragon had an ability to autogerenate its MAC address upon boot, or read it from a file (/lib/firmware/wlan/macaddr0). The linux-snapdragon kernel in Bionic doesn't have this ability. While by itself it's not a bug (Xenial used a QCOM provided custom driver, while Bionic uses the upstream wcn36xx driver) and can be easility workarounded by specifying the hw address in /etc/network/interfaces, or set via ifconfig on the commandline, it turned out to be a real problem on ubuntu core: 1) upon boot, with now MAC address assigned, the wcn36xx assigns itself the empty value "00:00:00:00:00" and that prevents the network interface to work at all, until a valid address is set 2) the ubuntu core installed doesn't have any knowledge about this, it tris to 'up' the interface and upon failure, it simply marks it as 'not working' On top of that, ubuntu core ships a small script in initramfs that generates the /lib/firmware/wlan/macaddr0 file starting from the android boot serial, effectively generating a unique MAC address per board: clearly, without driver support for this feature, the ubuntu core efforts fall flat. Fix: Import back from Xenial the MAC generation mechanism: the pseudo random generation and parsing of /lib/firmware/wlan/macaddr0 - see the attached patch. How to test: Unpon boot, if no /lib/firmware/wlan/macaddr0 is present, the kernel will print: [ 10.612701] wcn36xx a204000.wcnss:smd-edge:wcnss:wifi: Direct firmware load for wlan/macaddr0 failed with error -2 [ 10.612713] wcn36xx a204000.wcnss:smd-edge:wcnss:wifi: Failed (-2) to read macaddressfile wlan/macaddr0, using a random address instead ubuntu@dragon410c:~$ ifconfig wlan0 wlan0: flags=4098<BROADCAST,MULTICAST> mtu 1500 ether 00:0a:f5:d5:54:d7 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 else, if /lib/firmware/wlan/macaddr0 is present, its content will be used to generate wlan0 MAC address: ubuntu@dragon410c:~$ cat /lib/firmware/wlan/macaddr0 fe:1a:19:77:d9:88 ubuntu@dragon410c:~$ ifconfig wlan0 wlan0: flags=4098<BROADCAST,MULTICAST> mtu 1500 ether fe:1a:19:77:d9:88 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 Regression potential: Low - the patch is small and the code is wrapped in a Kconfig option (WCN36XX_SNAPDRAGON_HACKS) that only affects the linux-snapdragon flavour, leaving the generic kernel untouched. --- Impact: The wcn36xx driver in Xenial/linux-snapdragon had an ability to autogenerate its MAC address upon boot, or read it from a file (/lib/firmware/wlan/macaddr0). The linux-snapdragon kernel in Bionic doesn't have this feature. While by itself not a bug (Xenial used a QCOM provided custom driver, while Bionic uses the upstream wcn36xx driver), it can be easily work-arounded by specifying the hw address in /etc/network/interfaces, or set using ifconfig on the command line, but it turned out to be a real problem on ubuntu core: 1) upon boot, with no MAC address assigned, the wcn36xx assigns itself the dummy address "00:00:00:00:00" and that prevents the network interface from working at all, until a valid address is set 2) the ubuntu core installer doesn't have any knowledge about this behaviour, it simply tries to bring up the interface and on failure, it marks it as 'not working' On top of that, ubuntu core ships a small script in initramfs, that generates the /lib/firmware/wlan/macaddr0 file starting from the android boot serial, effectively generating a unique MAC address per board: clearly, without driver support, this ubuntu core feature doesn't work. Fix: Import back the MAC generation mechanism from Xenial: the pseudo random generation and the parsing of /lib/firmware/wlan/macaddr0 - see the attached patch. How to test: Unpon boot, if no /lib/firmware/wlan/macaddr0 is present, the kernel will print: [ 10.612701] wcn36xx a204000.wcnss:smd-edge:wcnss:wifi: Direct firmware load for wlan/macaddr0 failed with error -2 [ 10.612713] wcn36xx a204000.wcnss:smd-edge:wcnss:wifi: Failed (-2) to read macaddressfile wlan/macaddr0, using a random address instead ubuntu@dragon410c:~$ ifconfig wlan0 wlan0: flags=4098<BROADCAST,MULTICAST> mtu 1500 ether 00:0a:f5:d5:54:d7 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 else, if /lib/firmware/wlan/macaddr0 is present, its content will be used to generate wlan0 MAC address: ubuntu@dragon410c:~$ cat /lib/firmware/wlan/macaddr0 fe:1a:19:77:d9:88 ubuntu@dragon410c:~$ ifconfig wlan0 wlan0: flags=4098<BROADCAST,MULTICAST> mtu 1500 ether fe:1a:19:77:d9:88 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 Regression potential: Low - the patch is small and the code is wrapped in a Kconfig option (WCN36XX_SNAPDRAGON_HACKS) that only affects the linux-snapdragon flavour, leaving the generic kernel untouched. ---
2018-06-12 14:30:06 Ubuntu Kernel Bot linux (Ubuntu): status New Incomplete
2018-06-12 16:21:14 Ubuntu Foundations Team Bug Bot tags patch
2018-06-12 16:21:15 Ubuntu Foundations Team Bug Bot bug added subscriber Joseph Salisbury
2018-06-19 06:13:42 Khaled El Mously linux (Ubuntu): status Incomplete Fix Committed
2018-08-02 10:55:58 Stefan Bader nominated for series Ubuntu Bionic
2018-08-02 10:55:58 Stefan Bader bug task added linux (Ubuntu Bionic)
2018-08-02 10:56:09 Stefan Bader linux (Ubuntu Bionic): status New Fix Committed
2018-08-03 11:28:39 Launchpad Janitor linux (Ubuntu): status Fix Committed Fix Released
2018-08-07 14:02:34 Brad Figg tags patch patch verification-needed-bionic
2018-08-21 14:48:03 Kleber Sacilotto de Souza tags patch verification-needed-bionic patch verification-done-bionic
2018-08-23 13:23:09 Launchpad Janitor linux (Ubuntu Bionic): status Fix Committed Fix Released
2018-08-23 13:23:09 Launchpad Janitor cve linked 2018-10323
2018-08-23 13:23:09 Launchpad Janitor cve linked 2018-10840
2018-08-23 13:23:09 Launchpad Janitor cve linked 2018-10881
2018-08-23 13:23:09 Launchpad Janitor cve linked 2018-1108
2018-08-23 13:23:09 Launchpad Janitor cve linked 2018-11412
2018-08-23 13:23:09 Launchpad Janitor cve linked 2018-11506
2018-08-23 13:23:09 Launchpad Janitor cve linked 2018-12232
2018-08-23 13:23:09 Launchpad Janitor cve linked 2018-12233
2018-08-23 13:23:09 Launchpad Janitor cve linked 2018-12904
2018-08-23 13:23:09 Launchpad Janitor cve linked 2018-13094
2018-08-23 13:23:09 Launchpad Janitor cve linked 2018-13405
2018-08-23 13:23:09 Launchpad Janitor cve linked 2018-13406