]> git.baikalelectronics.ru Git - kernel.git/commit
[coredump] don't use __kernel_write() on kmap_local_page()
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 26 Sep 2022 15:59:14 +0000 (11:59 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 28 Sep 2022 18:28:40 +0000 (14:28 -0400)
commitef5eaef963e5f239182e95c67d927b11c46851d5
tree113842569565963748044a4b00498e31051a68c1
parent31e1fa2fe6243c66140701978c206269ac3cd9ad
[coredump] don't use __kernel_write() on kmap_local_page()

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: a51b9d4c671f "fs/coredump: use kmap_local_page()"
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/coredump.c
fs/internal.h
fs/read_write.c