]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: properly check all write ioctls for permissions
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Jul 2020 11:53:46 +0000 (13:53 +0200)
committerRichard Weinberger <richard@nod.at>
Fri, 24 Jul 2020 21:03:11 +0000 (23:03 +0200)
commit441cac9cbdaf87609e54868fd784c7a8aa25fecb
tree7b99597d0d1f8e0a6eb9457076b2741a9f4fbbf1
parent8c561b1d8dfacec79948f7d984ee1b4fc8b80ba7
mtd: properly check all write ioctls for permissions

When doing a "write" ioctl call, properly check that we have permissions
to do so before copying anything from userspace or anything else so we
can "fail fast".  This includes also covering the MEMWRITE ioctl which
previously missed checking for this.

Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Vignesh Raghavendra <vigneshr@ti.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[rw: Fixed locking issue]
Signed-off-by: Richard Weinberger <richard@nod.at>
drivers/mtd/mtdchar.c