File tree Expand file tree Collapse file tree 5 files changed +186
-35
lines changed Expand file tree Collapse file tree 5 files changed +186
-35
lines changed Original file line number Diff line number Diff line change 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 = true ;
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+ } ;
53+
54+ extraModulePackages = lib . mkIf config . hardware . broadcom . wifi . enableLegacyDriverWithKnownVulnerabilities [
55+ ( config . boot . kernelPackages . broadcom_sta . overrideAttrs ( oldAttrs : {
56+ meta =
57+ oldAttrs . meta
58+ // {
59+ knownVulnerabilities = [ ] ;
60+ } ;
61+ } ) )
62+ ] ;
63+
64+ hardware = {
65+ bluetooth . enable = lib . mkDefault true ;
66+ } ;
3667 } ;
3768}
Original file line number Diff line number Diff line change 33{
44 imports = [ ../. ] ;
55
6- boot . blacklistedKernelModules = [ "bcma" ] ;
6+ options = {
7+ hardware . broadcom . wifi . enableLegacyDriverWithKnownVulnerabilities = lib . mkOption {
8+ type = lib . types . bool ;
9+ default = true ;
10+ description = ''
11+ Enable the legacy Broadcom WiFi driver (wl) with known security vulnerabilities.
12+
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+ } ;
23+ } ;
724
8- boot = {
25+ config = {
26+ boot = {
927 # Divides power consumption by two.
10- kernelParams = [ "acpi_osi=" ] ;
11- } ;
28+ kernelParams = [ "acpi_osi=" ] ;
1229
13- services . xserver . deviceSection = lib . mkDefault ''
14- Option "TearFree" "true"
15- '' ;
30+ blacklistedKernelModules = [ "bcma" ] ;
31+ kernelModules = lib . mkIf config . hardware . broadcom . wifi . enableLegacyDriverWithKnownVulnerabilities [ "wl" ] ;
32+ extraModulePackages = lib . mkIf config . hardware . broadcom . wifi . enableLegacyDriverWithKnownVulnerabilities [
33+ ( config . boot . kernelPackages . broadcom_sta . overrideAttrs ( oldAttrs : {
34+ meta =
35+ oldAttrs . meta
36+ // {
37+ knownVulnerabilities = [ ] ;
38+ } ;
39+ } ) )
40+ ] ;
41+ } ;
42+
43+ services . xserver . deviceSection = lib . mkDefault ''
44+ Option "TearFree" "true"
45+ '' ;
46+ } ;
1647}
Original file line number Diff line number Diff line change 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 = true ;
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 = lib . mkIf config . hardware . broadcom . wifi . enableLegacyDriverWithKnownVulnerabilities [ "wl" ] ;
31+ boot . extraModulePackages = lib . mkIf config . hardware . broadcom . wifi . enableLegacyDriverWithKnownVulnerabilities [
32+ ( config . boot . kernelPackages . broadcom_sta . overrideAttrs ( oldAttrs : {
33+ meta =
34+ oldAttrs . meta
35+ // {
36+ knownVulnerabilities = [ ] ;
37+ } ;
38+ } ) )
39+ ] ;
40+ } ;
1041}
Original file line number Diff line number Diff line change 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 = true ;
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 = lib . mkIf config . hardware . broadcom . wifi . enableLegacyDriverWithKnownVulnerabilities [ "wl" ] ;
30+ boot . extraModulePackages = lib . mkIf config . hardware . broadcom . wifi . enableLegacyDriverWithKnownVulnerabilities [
31+ ( config . boot . kernelPackages . broadcom_sta . overrideAttrs ( oldAttrs : {
32+ meta =
33+ oldAttrs . meta
34+ // {
35+ knownVulnerabilities = [ ] ;
36+ } ;
37+ } ) )
38+ ] ;
39+
40+ services = {
41+ fwupd . enable = lib . mkDefault true ;
42+ thermald . enable = lib . mkDefault true ;
43+ } ;
1244 } ;
1345}
Original file line number Diff line number Diff line change 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 = true ;
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 = [
17- "kvm-intel"
29+ config = {
30+ boot . kernelModules = [ "kvm-intel" ] ++ lib . optionals config . hardware . broadcom . wifi . enableLegacyDriverWithKnownVulnerabilities [ "wl" ] ;
31+ boot . extraModulePackages = lib . mkIf config . hardware . broadcom . wifi . enableLegacyDriverWithKnownVulnerabilities [
32+ ( config . boot . kernelPackages . broadcom_sta . overrideAttrs ( oldAttrs : {
33+ meta =
34+ oldAttrs . meta
35+ // {
36+ knownVulnerabilities = [ ] ;
37+ } ;
38+ } ) )
1839 ] ;
40+
41+ services = {
42+ fwupd . enable = lib . mkDefault true ;
43+ thermald . enable = lib . mkDefault true ;
44+ } ;
1945 } ;
2046}
You can’t perform that action at this time.
0 commit comments