summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2017-04-04 11:54:30 -0400
committerDavid Howells <dhowells@redhat.com>2017-04-20 07:02:32 -0400
commit6192c41fc608b0a58d5540b015aa1672c266f3c5 (patch)
treed540aa76bfb291fe2c65eb6f96b54eb94a3c01a5
parent232b0b0829fa4f22172750a6e2a36867583da285 (diff)
Annotate hardware config module parameters in sound/pci/
When the kernel is running in secure boot mode, we lock down the kernel to prevent userspace from modifying the running kernel image. Whilst this includes prohibiting access to things like /dev/mem, it must also prevent access by means of configuring driver modules in such a way as to cause a device to access or modify the kernel image. To this end, annotate module_param* statements that refer to hardware configuration and indicate for future reference what type of parameter they specify. The parameter parser in the core sees this information and can skip such parameters with an error message if the kernel is locked down. The module initialisation then runs as normal, but just sees whatever the default values for those parameters is. Note that we do still need to do the module initialisation because some drivers have viable defaults set in case parameters aren't specified and some drivers support automatic configuration (e.g. PNP or PCI) in addition to manually coded parameters. This patch annotates drivers in sound/pci/. Suggested-by: Alan Cox <gnomes@lxorguk.ukuu.org.uk> Signed-off-by: David Howells <dhowells@redhat.com> cc: Jaroslav Kysela <perex@perex.cz> cc: Takashi Iwai <tiwai@suse.com> cc: alsa-devel@alsa-project.org
-rw-r--r--sound/pci/als4000.c2
-rw-r--r--sound/pci/cmipci.c6
-rw-r--r--sound/pci/ens1370.c2
-rw-r--r--sound/pci/riptide/riptide.c6
-rw-r--r--sound/pci/sonicvibes.c2
-rw-r--r--sound/pci/via82xx.c2
-rw-r--r--sound/pci/ymfpci/ymfpci.c6
7 files changed, 13 insertions, 13 deletions
diff --git a/sound/pci/als4000.c b/sound/pci/als4000.c
index 92bc06d01288..7844a75d8ed9 100644
--- a/sound/pci/als4000.c
+++ b/sound/pci/als4000.c
@@ -102,7 +102,7 @@ MODULE_PARM_DESC(id, "ID string for ALS4000 soundcard.");
102module_param_array(enable, bool, NULL, 0444); 102module_param_array(enable, bool, NULL, 0444);
103MODULE_PARM_DESC(enable, "Enable ALS4000 soundcard."); 103MODULE_PARM_DESC(enable, "Enable ALS4000 soundcard.");
104#ifdef SUPPORT_JOYSTICK 104#ifdef SUPPORT_JOYSTICK
105module_param_array(joystick_port, int, NULL, 0444); 105module_param_hw_array(joystick_port, int, ioport, NULL, 0444);
106MODULE_PARM_DESC(joystick_port, "Joystick port address for ALS4000 soundcard. (0 = disabled)"); 106MODULE_PARM_DESC(joystick_port, "Joystick port address for ALS4000 soundcard. (0 = disabled)");
107#endif 107#endif
108 108
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c
index aeedc270ed9b..430f064c64da 100644
--- a/sound/pci/cmipci.c
+++ b/sound/pci/cmipci.c
@@ -68,14 +68,14 @@ module_param_array(id, charp, NULL, 0444);
68MODULE_PARM_DESC(id, "ID string for C-Media PCI soundcard."); 68MODULE_PARM_DESC(id, "ID string for C-Media PCI soundcard.");
69module_param_array(enable, bool, NULL, 0444); 69module_param_array(enable, bool, NULL, 0444);
70MODULE_PARM_DESC(enable, "Enable C-Media PCI soundcard."); 70MODULE_PARM_DESC(enable, "Enable C-Media PCI soundcard.");
71module_param_array(mpu_port, long, NULL, 0444); 71module_param_hw_array(mpu_port, long, ioport, NULL, 0444);
72MODULE_PARM_DESC(mpu_port, "MPU-401 port."); 72MODULE_PARM_DESC(mpu_port, "MPU-401 port.");
73module_param_array(fm_port, long, NULL, 0444); 73module_param_hw_array(fm_port, long, ioport, NULL, 0444);
74MODULE_PARM_DESC(fm_port, "FM port."); 74MODULE_PARM_DESC(fm_port, "FM port.");
75module_param_array(soft_ac3, bool, NULL, 0444); 75module_param_array(soft_ac3, bool, NULL, 0444);
76MODULE_PARM_DESC(soft_ac3, "Software-conversion of raw SPDIF packets (model 033 only)."); 76MODULE_PARM_DESC(soft_ac3, "Software-conversion of raw SPDIF packets (model 033 only).");
77#ifdef SUPPORT_JOYSTICK 77#ifdef SUPPORT_JOYSTICK
78module_param_array(joystick_port, int, NULL, 0444); 78module_param_hw_array(joystick_port, int, ioport, NULL, 0444);
79MODULE_PARM_DESC(joystick_port, "Joystick port address."); 79MODULE_PARM_DESC(joystick_port, "Joystick port address.");
80#endif 80#endif
81 81
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c
index 164adad91650..90376739c5e1 100644
--- a/sound/pci/ens1370.c
+++ b/sound/pci/ens1370.c
@@ -106,7 +106,7 @@ module_param_array(enable, bool, NULL, 0444);
106MODULE_PARM_DESC(enable, "Enable Ensoniq AudioPCI soundcard."); 106MODULE_PARM_DESC(enable, "Enable Ensoniq AudioPCI soundcard.");
107#ifdef SUPPORT_JOYSTICK 107#ifdef SUPPORT_JOYSTICK
108#ifdef CHIP1371 108#ifdef CHIP1371
109module_param_array(joystick_port, int, NULL, 0444); 109module_param_hw_array(joystick_port, int, ioport, NULL, 0444);
110MODULE_PARM_DESC(joystick_port, "Joystick port address."); 110MODULE_PARM_DESC(joystick_port, "Joystick port address.");
111#else 111#else
112module_param_array(joystick, bool, NULL, 0444); 112module_param_array(joystick, bool, NULL, 0444);
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
index 19c9df6b0f3d..f067c76d77f8 100644
--- a/sound/pci/riptide/riptide.c
+++ b/sound/pci/riptide/riptide.c
@@ -137,12 +137,12 @@ MODULE_PARM_DESC(id, "ID string for Riptide soundcard.");
137module_param_array(enable, bool, NULL, 0444); 137module_param_array(enable, bool, NULL, 0444);
138MODULE_PARM_DESC(enable, "Enable Riptide soundcard."); 138MODULE_PARM_DESC(enable, "Enable Riptide soundcard.");
139#ifdef SUPPORT_JOYSTICK 139#ifdef SUPPORT_JOYSTICK
140module_param_array(joystick_port, int, NULL, 0444); 140module_param_hw_array(joystick_port, int, ioport, NULL, 0444);
141MODULE_PARM_DESC(joystick_port, "Joystick port # for Riptide soundcard."); 141MODULE_PARM_DESC(joystick_port, "Joystick port # for Riptide soundcard.");
142#endif 142#endif
143module_param_array(mpu_port, int, NULL, 0444); 143module_param_hw_array(mpu_port, int, ioport, NULL, 0444);
144MODULE_PARM_DESC(mpu_port, "MPU401 port # for Riptide driver."); 144MODULE_PARM_DESC(mpu_port, "MPU401 port # for Riptide driver.");
145module_param_array(opl3_port, int, NULL, 0444); 145module_param_hw_array(opl3_port, int, ioport, NULL, 0444);
146MODULE_PARM_DESC(opl3_port, "OPL3 port # for Riptide driver."); 146MODULE_PARM_DESC(opl3_port, "OPL3 port # for Riptide driver.");
147 147
148/* 148/*
diff --git a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c
index a6aa48c5b969..8e3d4ec39c35 100644
--- a/sound/pci/sonicvibes.c
+++ b/sound/pci/sonicvibes.c
@@ -66,7 +66,7 @@ module_param_array(reverb, bool, NULL, 0444);
66MODULE_PARM_DESC(reverb, "Enable reverb (SRAM is present) for S3 SonicVibes soundcard."); 66MODULE_PARM_DESC(reverb, "Enable reverb (SRAM is present) for S3 SonicVibes soundcard.");
67module_param_array(mge, bool, NULL, 0444); 67module_param_array(mge, bool, NULL, 0444);
68MODULE_PARM_DESC(mge, "MIC Gain Enable for S3 SonicVibes soundcard."); 68MODULE_PARM_DESC(mge, "MIC Gain Enable for S3 SonicVibes soundcard.");
69module_param(dmaio, uint, 0444); 69module_param_hw(dmaio, uint, ioport, 0444);
70MODULE_PARM_DESC(dmaio, "DDMA i/o base address for S3 SonicVibes soundcard."); 70MODULE_PARM_DESC(dmaio, "DDMA i/o base address for S3 SonicVibes soundcard.");
71 71
72/* 72/*
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
index 2d8c14e3f8d2..127834021175 100644
--- a/sound/pci/via82xx.c
+++ b/sound/pci/via82xx.c
@@ -92,7 +92,7 @@ module_param(index, int, 0444);
92MODULE_PARM_DESC(index, "Index value for VIA 82xx bridge."); 92MODULE_PARM_DESC(index, "Index value for VIA 82xx bridge.");
93module_param(id, charp, 0444); 93module_param(id, charp, 0444);
94MODULE_PARM_DESC(id, "ID string for VIA 82xx bridge."); 94MODULE_PARM_DESC(id, "ID string for VIA 82xx bridge.");
95module_param(mpu_port, long, 0444); 95module_param_hw(mpu_port, long, ioport, 0444);
96MODULE_PARM_DESC(mpu_port, "MPU-401 port. (VT82C686x only)"); 96MODULE_PARM_DESC(mpu_port, "MPU-401 port. (VT82C686x only)");
97#ifdef SUPPORT_JOYSTICK 97#ifdef SUPPORT_JOYSTICK
98module_param(joystick, bool, 0444); 98module_param(joystick, bool, 0444);
diff --git a/sound/pci/ymfpci/ymfpci.c b/sound/pci/ymfpci/ymfpci.c
index 812e27a1bcbc..4faf3e1ed06a 100644
--- a/sound/pci/ymfpci/ymfpci.c
+++ b/sound/pci/ymfpci/ymfpci.c
@@ -55,12 +55,12 @@ module_param_array(id, charp, NULL, 0444);
55MODULE_PARM_DESC(id, "ID string for the Yamaha DS-1 PCI soundcard."); 55MODULE_PARM_DESC(id, "ID string for the Yamaha DS-1 PCI soundcard.");
56module_param_array(enable, bool, NULL, 0444); 56module_param_array(enable, bool, NULL, 0444);
57MODULE_PARM_DESC(enable, "Enable Yamaha DS-1 soundcard."); 57MODULE_PARM_DESC(enable, "Enable Yamaha DS-1 soundcard.");
58module_param_array(mpu_port, long, NULL, 0444); 58module_param_hw_array(mpu_port, long, ioport, NULL, 0444);
59MODULE_PARM_DESC(mpu_port, "MPU-401 Port."); 59MODULE_PARM_DESC(mpu_port, "MPU-401 Port.");
60module_param_array(fm_port, long, NULL, 0444); 60module_param_hw_array(fm_port, long, ioport, NULL, 0444);
61MODULE_PARM_DESC(fm_port, "FM OPL-3 Port."); 61MODULE_PARM_DESC(fm_port, "FM OPL-3 Port.");
62#ifdef SUPPORT_JOYSTICK 62#ifdef SUPPORT_JOYSTICK
63module_param_array(joystick_port, long, NULL, 0444); 63module_param_hw_array(joystick_port, long, ioport, NULL, 0444);
64MODULE_PARM_DESC(joystick_port, "Joystick port address"); 64MODULE_PARM_DESC(joystick_port, "Joystick port address");
65#endif 65#endif
66module_param_array(rear_switch, bool, NULL, 0444); 66module_param_array(rear_switch, bool, NULL, 0444);