|
3 | 3 | { |
4 | 4 | imports = [ ../. ]; |
5 | 5 |
|
6 | | - boot.blacklistedKernelModules = [ "bcma" ]; |
| 6 | + options = { |
| 7 | + hardware.broadcom.wifi.enableLegacyDriverWithKnownVulnerabilities = lib.mkOption { |
| 8 | + type = lib.types.bool; |
| 9 | + default = false; |
| 10 | + description = '' |
| 11 | + Enable the legacy Broadcom WiFi driver (wl) with known security vulnerabilities. |
7 | 12 |
|
8 | | - boot = { |
9 | | - # Divides power consumption by two. |
10 | | - kernelParams = [ "acpi_osi=" ]; |
| 13 | + This driver is vulnerable to heap buffer overflows: |
| 14 | + - CVE-2019-9501 (https://github.com/advisories/GHSA-vjw8-c937-7hwp) |
| 15 | + - CVE-2019-9502 (https://github.com/advisories/GHSA-4rfg-8q34-prmp) |
| 16 | +
|
| 17 | + Attackers within WiFi range can exploit this vulnerability by sending crafted |
| 18 | + WiFi packets, even without being connected to the same network. Simply having |
| 19 | + WiFi enabled makes the system vulnerable to arbitrary code execution or denial-of-service. |
| 20 | + Only enable if no alternative WiFi solution is available. |
| 21 | + ''; |
| 22 | + }; |
11 | 23 | }; |
12 | 24 |
|
13 | | - services.xserver.deviceSection = lib.mkDefault '' |
14 | | - Option "TearFree" "true" |
15 | | - ''; |
| 25 | + config = { |
| 26 | + boot = { |
| 27 | + # Divides power consumption by two. |
| 28 | + kernelParams = [ "acpi_osi=" ]; |
| 29 | + |
| 30 | + blacklistedKernelModules = [ "bcma" ]; |
| 31 | + kernelModules = lib.mkIf config.hardware.broadcom.wifi.enableLegacyDriverWithKnownVulnerabilities [ |
| 32 | + "wl" |
| 33 | + ]; |
| 34 | + extraModulePackages = |
| 35 | + lib.mkIf config.hardware.broadcom.wifi.enableLegacyDriverWithKnownVulnerabilities |
| 36 | + [ |
| 37 | + (config.boot.kernelPackages.broadcom_sta.overrideAttrs (oldAttrs: { |
| 38 | + meta = oldAttrs.meta // { |
| 39 | + knownVulnerabilities = [ ]; |
| 40 | + }; |
| 41 | + })) |
| 42 | + ]; |
| 43 | + }; |
| 44 | + |
| 45 | + services.xserver.deviceSection = lib.mkDefault '' |
| 46 | + Option "TearFree" "true" |
| 47 | + ''; |
| 48 | + }; |
16 | 49 | } |
0 commit comments