mtd: phram: Add the kernel lock down check
Subsystems (2)
PATCH 1/1 mtd: phram: Add the kernel lock down check
The phram MTD driver may map any memory pages no matter whether it's reserved or whatever used for systems, which basically allows user bypassing the lock down.
Add the check and abort the probe if the kernel is locked down for LOCKDOWN_DEV_MEM.
--- drivers/mtd/devices/phram.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/mtd/devices/phram.c +5 -0
@@ -30,6 +30,7 @@#include <linux/platform_device.h> #include <linux/of_address.h> #include <linux/of.h> +#include <linux/security.h> struct phram_mtd_list {struct mtd_info mtd;
@@ -410,6 +411,10 @@ static int __init init_phram(void) {int ret; + ret =security_locked_down (LOCKDOWN_DEV_MEM ); +if (ret) +return ret; + ret =platform_driver_register (&phram_driver);if (ret)return ret;
Signature · 1 line
2.43.0
----- Ursprüngliche Mail -----
Quoted 11 lines
Von: "Takashi Iwai" <[email protected]>
An: "linux-mtd" <[email protected]>
CC: "joern" <[email protected]>, "Miquel Raynal" <[email protected]>, "richard" <[email protected]>, "Vignesh Raghavendra" <[email protected]>, "linux-kernel" <[email protected]>, "Fabian Vogt" <[email protected]>
Gesendet: Donnerstag, 14. November 2024 16:44:41
Betreff: [PATCH] mtd: phram: Add the kernel lock down checkThe phram MTD driver may map any memory pages no matter whether it's reserved or whatever used for systems, which basically allows user bypassing the lock down.
Quoted 6 lines
Add the check and abort the probe if the kernel is locked down for
LOCKDOWN_DEV_MEM.Reported-by Fabian Vogt <[email protected]>Suggested-by Fabian Vogt <[email protected]>Signed-off-by Takashi Iwai <[email protected]>
Good catch!
Thanks,
//richard
Quoted 10 lines · Takashi Iwai
The phram MTD driver may map any memory pages no matter whether it's reserved or whatever used for systems, which basically allows user bypassing the lock down.
Add the check and abort the probe if the kernel is locked down for
LOCKDOWN_DEV_MEM.Reported-by Fabian Vogt <[email protected]>Suggested-by Fabian Vogt <[email protected]>Signed-off-by Takashi Iwai <[email protected]>
Applied to mtd/next.
Thanks,
Miquèl