mtd: phram: Add the kernel lock down check
authorTakashi Iwai <tiwai@suse.de>
Thu, 14 Nov 2024 15:44:41 +0000 (16:44 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 5 Dec 2024 10:11:44 +0000 (11:11 +0100)
commitb3c782868ecebd0c1661a6aa2bdc84cd3cbb1ef3
tree94f169e99fa5e5af75500c459296b26bedee9bf0
parent78a56df609460e8e708cb4500d624dc8a3732cfa
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.

Reported-by: Fabian Vogt <fvogt@suse.com>
Suggested-by: Fabian Vogt <fvogt@suse.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/devices/phram.c