From: David Howells Date: Wed, 8 Nov 2017 15:11:35 +0000 (+0000) Subject: scsi: Lock down the eata driver X-Git-Tag: archive/raspbian/4.16.12-1+rpi1^2~30 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=87a5a7d8e3b74eef77d79ec937a8eed6b2e15d0b;p=linux.git scsi: Lock down the eata driver 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. The eata driver takes a single string parameter that contains a slew of settings, including hardware resource configuration. Prohibit use of the parameter if the kernel is locked down. Suggested-by: Alan Cox Signed-off-by: David Howells cc: Dario Ballabio cc: "James E.J. Bottomley" cc: "Martin K. Petersen" cc: linux-scsi@vger.kernel.org Gbp-Pq: Topic features/all/lockdown Gbp-Pq: Name 0019-scsi-Lock-down-the-eata-driver.patch --- diff --git a/drivers/scsi/eata.c b/drivers/scsi/eata.c index 6501c330d8c..72fceaa8f3d 100644 --- a/drivers/scsi/eata.c +++ b/drivers/scsi/eata.c @@ -1552,8 +1552,11 @@ static int eata2x_detect(struct scsi_host_template *tpnt) tpnt->proc_name = "eata2x"; - if (strlen(boot_options)) + if (strlen(boot_options)) { + if (kernel_is_locked_down("Command line-specified device addresses, irqs and dma channels")) + return -EPERM; option_setup(boot_options); + } #if defined(MODULE) /* io_port could have been modified when loading as a module */