aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2017-04-04 11:54:27 -0400
committerDavid Howells <dhowells@redhat.com>2017-04-20 07:02:32 -0400
commitaf28a03c1b1eae4d7c97f4bd0c6326522c8a3bc9 (patch)
tree993bf7be0969a561695c63fef7767cede470e80f
parent4f06e652721da79e032d3ba38bc1589bd553a5fc (diff)
Annotate hardware config module parameters in drivers/net/wan/
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 drivers/net/wan/. Suggested-by: Alan Cox <gnomes@lxorguk.ukuu.org.uk> Signed-off-by: David Howells <dhowells@redhat.com> cc: "Jan \"Yenya\" Kasprzak" <kas@fi.muni.cz> cc: netdev@vger.kernel.org
-rw-r--r--drivers/net/wan/cosa.c6
-rw-r--r--drivers/net/wan/hostess_sv11.c6
-rw-r--r--drivers/net/wan/sbni.c4
-rw-r--r--drivers/net/wan/sealevel.c8
4 files changed, 12 insertions, 12 deletions
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
index 4ca71bca39ac..6ea16260ec76 100644
--- a/drivers/net/wan/cosa.c
+++ b/drivers/net/wan/cosa.c
@@ -232,11 +232,11 @@ static int irq[MAX_CARDS+1] = { -1, -1, -1, -1, -1, -1, 0, };
232static struct class *cosa_class; 232static struct class *cosa_class;
233 233
234#ifdef MODULE 234#ifdef MODULE
235module_param_array(io, int, NULL, 0); 235module_param_hw_array(io, int, ioport, NULL, 0);
236MODULE_PARM_DESC(io, "The I/O bases of the COSA or SRP cards"); 236MODULE_PARM_DESC(io, "The I/O bases of the COSA or SRP cards");
237module_param_array(irq, int, NULL, 0); 237module_param_hw_array(irq, int, irq, NULL, 0);
238MODULE_PARM_DESC(irq, "The IRQ lines of the COSA or SRP cards"); 238MODULE_PARM_DESC(irq, "The IRQ lines of the COSA or SRP cards");
239module_param_array(dma, int, NULL, 0); 239module_param_hw_array(dma, int, dma, NULL, 0);
240MODULE_PARM_DESC(dma, "The DMA channels of the COSA or SRP cards"); 240MODULE_PARM_DESC(dma, "The DMA channels of the COSA or SRP cards");
241 241
242MODULE_AUTHOR("Jan \"Yenya\" Kasprzak, <kas@fi.muni.cz>"); 242MODULE_AUTHOR("Jan \"Yenya\" Kasprzak, <kas@fi.muni.cz>");
diff --git a/drivers/net/wan/hostess_sv11.c b/drivers/net/wan/hostess_sv11.c
index dd6bb3364ad2..4de0737fbf8a 100644
--- a/drivers/net/wan/hostess_sv11.c
+++ b/drivers/net/wan/hostess_sv11.c
@@ -324,11 +324,11 @@ static void sv11_shutdown(struct z8530_dev *dev)
324static int io = 0x200; 324static int io = 0x200;
325static int irq = 9; 325static int irq = 9;
326 326
327module_param(io, int, 0); 327module_param_hw(io, int, ioport, 0);
328MODULE_PARM_DESC(io, "The I/O base of the Comtrol Hostess SV11 card"); 328MODULE_PARM_DESC(io, "The I/O base of the Comtrol Hostess SV11 card");
329module_param(dma, int, 0); 329module_param_hw(dma, int, dma, 0);
330MODULE_PARM_DESC(dma, "Set this to 1 to use DMA1/DMA3 for TX/RX"); 330MODULE_PARM_DESC(dma, "Set this to 1 to use DMA1/DMA3 for TX/RX");
331module_param(irq, int, 0); 331module_param_hw(irq, int, irq, 0);
332MODULE_PARM_DESC(irq, "The interrupt line setting for the Comtrol Hostess SV11 card"); 332MODULE_PARM_DESC(irq, "The interrupt line setting for the Comtrol Hostess SV11 card");
333 333
334MODULE_AUTHOR("Alan Cox"); 334MODULE_AUTHOR("Alan Cox");
diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c
index 3ca3419c54a0..bde8c0339831 100644
--- a/drivers/net/wan/sbni.c
+++ b/drivers/net/wan/sbni.c
@@ -1463,8 +1463,8 @@ set_multicast_list( struct net_device *dev )
1463 1463
1464 1464
1465#ifdef MODULE 1465#ifdef MODULE
1466module_param_array(io, int, NULL, 0); 1466module_param_hw_array(io, int, ioport, NULL, 0);
1467module_param_array(irq, int, NULL, 0); 1467module_param_hw_array(irq, int, irq, NULL, 0);
1468module_param_array(baud, int, NULL, 0); 1468module_param_array(baud, int, NULL, 0);
1469module_param_array(rxl, int, NULL, 0); 1469module_param_array(rxl, int, NULL, 0);
1470module_param_array(mac, int, NULL, 0); 1470module_param_array(mac, int, NULL, 0);
diff --git a/drivers/net/wan/sealevel.c b/drivers/net/wan/sealevel.c
index fbb5aa2c4d8f..c56f2c252113 100644
--- a/drivers/net/wan/sealevel.c
+++ b/drivers/net/wan/sealevel.c
@@ -363,13 +363,13 @@ static int rxdma=3;
363static int irq=5; 363static int irq=5;
364static bool slow=false; 364static bool slow=false;
365 365
366module_param(io, int, 0); 366module_param_hw(io, int, ioport, 0);
367MODULE_PARM_DESC(io, "The I/O base of the Sealevel card"); 367MODULE_PARM_DESC(io, "The I/O base of the Sealevel card");
368module_param(txdma, int, 0); 368module_param_hw(txdma, int, dma, 0);
369MODULE_PARM_DESC(txdma, "Transmit DMA channel"); 369MODULE_PARM_DESC(txdma, "Transmit DMA channel");
370module_param(rxdma, int, 0); 370module_param_hw(rxdma, int, dma, 0);
371MODULE_PARM_DESC(rxdma, "Receive DMA channel"); 371MODULE_PARM_DESC(rxdma, "Receive DMA channel");
372module_param(irq, int, 0); 372module_param_hw(irq, int, irq, 0);
373MODULE_PARM_DESC(irq, "The interrupt line setting for the SeaLevel card"); 373MODULE_PARM_DESC(irq, "The interrupt line setting for the SeaLevel card");
374module_param(slow, bool, 0); 374module_param(slow, bool, 0);
375MODULE_PARM_DESC(slow, "Set this for an older Sealevel card such as the 4012"); 375MODULE_PARM_DESC(slow, "Set this for an older Sealevel card such as the 4012");