]> git.baikalelectronics.ru Git - kernel.git/commit
fs: don't allow kernel reads and writes without iter ops
authorChristoph Hellwig <hch@lst.de>
Thu, 3 Sep 2020 14:22:33 +0000 (16:22 +0200)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 9 Sep 2020 02:21:31 +0000 (22:21 -0400)
commitc7a6122d840431591d2d86ab7d28a027662b1a90
tree47b12f217a59842f4b5e25bca6b4ab038b10dbc0
parent5f884eb9bea7c821363951b44d6b42ecfdf7ea34
fs: don't allow kernel reads and writes without iter ops

Don't allow calling ->read or ->write with set_fs as a preparation for
killing off set_fs.  All the instances that we use kernel_read/write on
are using the iter ops already.

If a file has both the regular ->read/->write methods and the iter
variants those could have different semantics for messed up enough
drivers.  Also fails the kernel access to them in that case.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/read_write.c