]> git.baikalelectronics.ru Git - kernel.git/commit
fs: don't allow splice read/write without explicit ops
authorChristoph Hellwig <hch@lst.de>
Thu, 3 Sep 2020 14:22:34 +0000 (16:22 +0200)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 9 Sep 2020 02:21:32 +0000 (22:21 -0400)
commitec25677859f224d660d86ae6d6728e7418546635
tree43b45747ad654e093c8d4a7dd9a90456590c2321
parent799cac08a758b4d3882586b33a363da0c7f27d89
fs: don't allow splice read/write without explicit ops

default_file_splice_write is the last piece of generic code that uses
set_fs to make the uaccess routines operate on kernel pointers.  It
implements a "fallback loop" for splicing from files that do not actually
provide a proper splice_read method.  The usual file systems and other
high bandwidth instances all provide a ->splice_read, so this just removes
support for various device drivers and procfs/debugfs files.  If splice
support for any of those turns out to be important it can be added back
by switching them to the iter ops and using generic_file_splice_read.

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
fs/splice.c
include/linux/fs.h