|
|
Log in / Subscribe / Register

Re: [PATCH] Lock down drivers that can have io ports, io mem, irqs and dma changed

From:  One Thousand Gnomes <gnomes-qBU/x9rampVanCEyBjwyrvXRex20P6io-AT-public.gmane.org>
To:  David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA-AT-public.gmane.org>
Subject:  Re: [PATCH] Lock down drivers that can have io ports, io mem, irqs and dma changed
Date:  Wed, 30 Nov 2016 14:41:05 +0000
Message-ID:  <20161130144105.2b6be4fe@lxorguk.ukuu.org.uk>
Cc:  minyard-HInyCGIudOg-AT-public.gmane.org, keyrings-u79uwXL29TY76Z2rM5mHXA-AT-public.gmane.org, matthew.garrett-05XSO3Yj/JvQT0dZR+AlfA-AT-public.gmane.org, linux-security-module-u79uwXL29TY76Z2rM5mHXA-AT-public.gmane.org, linux-efi-u79uwXL29TY76Z2rM5mHXA-AT-public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA-AT-public.gmane.org

On Tue, 29 Nov 2016 14:03:31 +0000
David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:

> How about the attached?  Obviously it need extending to other drivers.
> 
> I thought that if I'm changing the module_param annotations anyway then it's
> probably worth bunging in an extra parameter that notes what the parameter
> modifies (ioport, iomem, etc.) for future reference, even if we don't store
> it.


With a security hat on the security best practice and long standing
accepted rule is that you whitelist rather than blacklist, so there ought
to be a 

module_param_safe_array()
etc

to mark parameters that are safe, not the reverse.


That debate aside I think the patch is exactly what is needed for this,
and is probably useful for more general hardening as well.

Alan


to post comments


Copyright © 2016, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds