]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/tty/serial/serial_core.c
UBUNTU: SAUCE: (efi-lockdown) Lock down TIOCSSERIAL
[mirror_ubuntu-artful-kernel.git] / drivers / tty / serial / serial_core.c
index f534a40aebdeeadba3f344f229f1b8ac067370d1..e32c0179f423c4aed9687c582bcd7000b14dbac2 100644 (file)
@@ -821,6 +821,12 @@ static int uart_set_info(struct tty_struct *tty, struct tty_port *port,
        new_flags = new_info->flags;
        old_custom_divisor = uport->custom_divisor;
 
+       if ((change_port || change_irq) && kernel_is_locked_down()) {
+               pr_err("Using TIOCSSERIAL to change device addresses, irqs and dma channels is not permitted when the kernel is locked down\n");
+               retval = -EPERM;
+               goto exit;
+       }
+
        if (!capable(CAP_SYS_ADMIN)) {
                retval = -EPERM;
                if (change_irq || change_port ||