https://github.com/torvalds/linux
Revision 06bbaa6dc53cb72040db952053432541acb9adc7 authored by Al Viro on 26 September 2022, 15:59:14 UTC, committed by Al Viro on 28 September 2022, 18:28:40 UTC
passing kmap_local_page() result to __kernel_write() is unsafe -
random ->write_iter() might (and 9p one does) get unhappy when
passed ITER_KVEC with pointer that came from kmap_local_page().

Fix by providing a variant of __kernel_write() that takes an iov_iter
from caller (__kernel_write() becomes a trivial wrapper) and adding
dump_emit_page() that parallels dump_emit(), except that instead of
__kernel_write() it uses __kernel_write_iter() with ITER_BVEC source.

Fixes: 3159ed57792b "fs/coredump: use kmap_local_page()"
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent bfbfb61
Raw File
Tip revision: 06bbaa6dc53cb72040db952053432541acb9adc7 authored by Al Viro on 26 September 2022, 15:59:14 UTC
[coredump] don't use __kernel_write() on kmap_local_page()
Tip revision: 06bbaa6
README
Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.
back to top