[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <95ae3781-2c2c-fb2a-7e1b-3732acaa603e@acm.org>
Date: Thu, 1 Dec 2016 07:14:35 -0600
From: Corey Minyard <minyard@....org>
To: David Howells <dhowells@...hat.com>, linux-kernel@...r.kernel.org
Cc: gnomes@...rguk.ukuu.org.uk, linux-security-module@...r.kernel.org,
keyrings@...r.kernel.org, openipmi-developer@...ts.sourceforge.net
Subject: Re: [PATCH 03/39] Annotate hardware config module parameters in
drivers/char/ipmi/
On 12/01/2016 06:30 AM, David Howells wrote:
> 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/char/ipmi/.
>
> Suggested-by: One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>
> Signed-off-by: David Howells <dhowells@...hat.com>
> cc: Corey Minyard <minyard@....org>
> cc: openipmi-developer@...ts.sourceforge.net
Reviewed by: Corey Minyard <cminyard@...sta.com>
> ---
>
> drivers/char/ipmi/ipmi_si_intf.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
> index a112c0146012..157e96391eca 100644
> --- a/drivers/char/ipmi/ipmi_si_intf.c
> +++ b/drivers/char/ipmi/ipmi_si_intf.c
> @@ -1375,39 +1375,39 @@ MODULE_PARM_DESC(type, "Defines the type of each interface, each"
> " interface separated by commas. The types are 'kcs',"
> " 'smic', and 'bt'. For example si_type=kcs,bt will set"
> " the first interface to kcs and the second to bt");
> -module_param_array(addrs, ulong, &num_addrs, 0);
> +module_param_hw_array(addrs, ulong, iomem, &num_addrs, 0);
> MODULE_PARM_DESC(addrs, "Sets the memory address of each interface, the"
> " addresses separated by commas. Only use if an interface"
> " is in memory. Otherwise, set it to zero or leave"
> " it blank.");
> -module_param_array(ports, uint, &num_ports, 0);
> +module_param_hw_array(ports, uint, ioport, &num_ports, 0);
> MODULE_PARM_DESC(ports, "Sets the port address of each interface, the"
> " addresses separated by commas. Only use if an interface"
> " is a port. Otherwise, set it to zero or leave"
> " it blank.");
> -module_param_array(irqs, int, &num_irqs, 0);
> +module_param_hw_array(irqs, int, irq, &num_irqs, 0);
> MODULE_PARM_DESC(irqs, "Sets the interrupt of each interface, the"
> " addresses separated by commas. Only use if an interface"
> " has an interrupt. Otherwise, set it to zero or leave"
> " it blank.");
> -module_param_array(regspacings, int, &num_regspacings, 0);
> +module_param_hw_array(regspacings, int, other, &num_regspacings, 0);
> MODULE_PARM_DESC(regspacings, "The number of bytes between the start address"
> " and each successive register used by the interface. For"
> " instance, if the start address is 0xca2 and the spacing"
> " is 2, then the second address is at 0xca4. Defaults"
> " to 1.");
> -module_param_array(regsizes, int, &num_regsizes, 0);
> +module_param_hw_array(regsizes, int, other, &num_regsizes, 0);
> MODULE_PARM_DESC(regsizes, "The size of the specific IPMI register in bytes."
> " This should generally be 1, 2, 4, or 8 for an 8-bit,"
> " 16-bit, 32-bit, or 64-bit register. Use this if you"
> " the 8-bit IPMI register has to be read from a larger"
> " register.");
> -module_param_array(regshifts, int, &num_regshifts, 0);
> +module_param_hw_array(regshifts, int, other, &num_regshifts, 0);
> MODULE_PARM_DESC(regshifts, "The amount to shift the data read from the."
> " IPMI register, in bits. For instance, if the data"
> " is read from a 32-bit word and the IPMI data is in"
> " bit 8-15, then the shift would be 8");
> -module_param_array(slave_addrs, int, &num_slave_addrs, 0);
> +module_param_hw_array(slave_addrs, int, other, &num_slave_addrs, 0);
> MODULE_PARM_DESC(slave_addrs, "Set the default IPMB slave address for"
> " the controller. Normally this is 0x20, but can be"
> " overridden by this parm. This is an array indexed"
>
Powered by blists - more mailing lists