Skip to content

Commit 8b5480f

Browse files
committed
broadcom-wl: enable WiFi/Bluetooth driver as discussed in PR #1580
1 parent 899dc44 commit 8b5480f

File tree

5 files changed

+194
-35
lines changed

5 files changed

+194
-35
lines changed

apple/imac/14-2/default.nix

Lines changed: 48 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,55 @@
1313
../../../common/hidpi.nix
1414
];
1515

16-
boot = {
17-
initrd.kernelModules = [
18-
"applesmc"
19-
"applespi"
20-
"intel_lpss_pci"
21-
"spi_pxa2xx_platform"
22-
"kvm-intel"
23-
];
24-
blacklistedKernelModules = [
25-
"b43"
26-
"ssb"
27-
"brcmfmac"
28-
"brcmsmac"
29-
"bcma"
30-
];
31-
kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.0") pkgs.linuxPackages_latest;
16+
options = {
17+
hardware.broadcom.wifi.enableLegacyDriverWithKnownVulnerabilities = lib.mkOption {
18+
type = lib.types.bool;
19+
default = false;
20+
description = ''
21+
Enable the legacy Broadcom WiFi driver (wl) with known security vulnerabilities.
22+
23+
This driver is vulnerable to heap buffer overflows:
24+
- CVE-2019-9501 (https://github.com/advisories/GHSA-vjw8-c937-7hwp)
25+
- CVE-2019-9502 (https://github.com/advisories/GHSA-4rfg-8q34-prmp)
26+
27+
Attackers within WiFi range can exploit this vulnerability by sending crafted
28+
WiFi packets, even without being connected to the same network. Simply having
29+
WiFi enabled makes the system vulnerable to arbitrary code execution or denial-of-service.
30+
Only enable if no alternative WiFi solution is available.
31+
'';
32+
};
3233
};
3334

34-
hardware = {
35-
bluetooth.enable = lib.mkDefault true;
35+
config = {
36+
boot = {
37+
initrd.kernelModules = [
38+
"applesmc"
39+
"applespi"
40+
"intel_lpss_pci"
41+
"spi_pxa2xx_platform"
42+
"kvm-intel"
43+
];
44+
blacklistedKernelModules = [
45+
"b43"
46+
"ssb"
47+
"brcmfmac"
48+
"brcmsmac"
49+
"bcma"
50+
];
51+
kernelPackages = lib.mkIf (lib.versionOlder pkgs.linux.version "6.0") pkgs.linuxPackages_latest;
52+
extraModulePackages =
53+
lib.mkIf config.hardware.broadcom.wifi.enableLegacyDriverWithKnownVulnerabilities
54+
[
55+
(config.boot.kernelPackages.broadcom_sta.overrideAttrs (oldAttrs: {
56+
meta = oldAttrs.meta // {
57+
knownVulnerabilities = [ ];
58+
};
59+
}))
60+
];
61+
};
62+
63+
hardware = {
64+
bluetooth.enable = lib.mkDefault true;
65+
};
3666
};
3767
}

apple/macbook-air/6/default.nix

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,47 @@
33
{
44
imports = [ ../. ];
55

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.
712
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+
};
1123
};
1224

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+
};
1649
}

apple/macbook-pro/11-1/default.nix

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,38 @@
66
../../../common/cpu/intel/haswell
77
];
88

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

dell/inspiron/3442/default.nix

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,42 @@
66
../../../common/pc/laptop
77
];
88

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

dell/xps/13-9343/default.nix

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,43 @@
77
../../../common/pc/ssd
88
];
99

10-
services = {
11-
fwupd.enable = lib.mkDefault true;
12-
thermald.enable = lib.mkDefault true;
10+
options = {
11+
hardware.broadcom.wifi.enableLegacyDriverWithKnownVulnerabilities = lib.mkOption {
12+
type = lib.types.bool;
13+
default = false;
14+
description = ''
15+
Enable the legacy Broadcom WiFi driver (wl) with known security vulnerabilities.
16+
17+
This driver is vulnerable to heap buffer overflows:
18+
- CVE-2019-9501 (https://github.com/advisories/GHSA-vjw8-c937-7hwp)
19+
- CVE-2019-9502 (https://github.com/advisories/GHSA-4rfg-8q34-prmp)
20+
21+
Attackers within WiFi range can exploit this vulnerability by sending crafted
22+
WiFi packets, even without being connected to the same network. Simply having
23+
WiFi enabled makes the system vulnerable to arbitrary code execution or denial-of-service.
24+
Only enable if no alternative WiFi solution is available.
25+
'';
26+
};
1327
};
1428

15-
boot = {
16-
kernelModules = [
29+
config = {
30+
boot.kernelModules = [
1731
"kvm-intel"
18-
];
32+
]
33+
++ lib.optionals config.hardware.broadcom.wifi.enableLegacyDriverWithKnownVulnerabilities [ "wl" ];
34+
boot.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+
services = {
45+
fwupd.enable = lib.mkDefault true;
46+
thermald.enable = lib.mkDefault true;
47+
};
1948
};
2049
}

0 commit comments

Comments
 (0)