Prohibit PCMCIA CIS storage when the kernel is locked down
authorDavid Howells <dhowells@redhat.com>
Wed, 8 Nov 2017 15:11:35 +0000 (15:11 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 19 Apr 2018 10:13:03 +0000 (11:13 +0100)
Prohibit replacement of the PCMCIA Card Information Structure when the
kernel is locked down.

Suggested-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: linux-pcmcia@lists.infradead.org

Gbp-Pq: Topic features/all/lockdown
Gbp-Pq: Name 0020-Prohibit-PCMCIA-CIS-storage-when-the-kernel-is-locke.patch

drivers/pcmcia/cistpl.c

index 102646fedb5602b94c7f223aa4b2ffe32d5f25e0..e46c948d724659ff157605a0af50a550063bd9e8 100644 (file)
@@ -1578,6 +1578,9 @@ static ssize_t pccard_store_cis(struct file *filp, struct kobject *kobj,
        struct pcmcia_socket *s;
        int error;
 
+       if (kernel_is_locked_down("Direct PCMCIA CIS storage"))
+               return -EPERM;
+
        s = to_socket(container_of(kobj, struct device, kobj));
 
        if (off)