--- zzzz-none-000/linux-4.9.231/drivers/mtd/mtdchar.c 2020-07-22 07:10:54.000000000 +0000 +++ falcon-5530-730/linux-4.9.231/drivers/mtd/mtdchar.c 2022-08-31 08:19:49.000000000 +0000 @@ -1063,6 +1063,9 @@ { int ret; + if (!capable(CAP_SYS_RESOURCE)) + return -EPERM; + mutex_lock(&mtd_mutex); ret = mtdchar_ioctl(file, cmd, arg); mutex_unlock(&mtd_mutex); @@ -1089,6 +1092,9 @@ void __user *argp = compat_ptr(arg); int ret = 0; + if (!capable(CAP_SYS_RESOURCE)) + return -EPERM; + mutex_lock(&mtd_mutex); switch (cmd) {