Prohibit PCMCIA CIS storage when the kernel is locked down
authorDavid Howells <dhowells@redhat.com>
Mon, 18 Feb 2019 12:45:00 +0000 (12:45 +0000)
committerSalvatore Bonaccorso <carnil@debian.org>
Thu, 26 Sep 2019 12:19:06 +0000 (13:19 +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 0019-Prohibit-PCMCIA-CIS-storage-when-the-kernel-is-locke.patch

drivers/pcmcia/cistpl.c

index abd029945cc8cf7fd1866d8ea4570e903bab1e06..77919fa3fb4acdf8703f4dfc908e477892c3f8f5 100644 (file)
@@ -1575,6 +1575,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)