fs/proc/kcore.c: Add bounce buffer for ktext data
authorJiri Olsa <jolsa@kernel.org>
Thu, 8 Sep 2016 07:57:08 +0000 (09:57 +0200)
committerAlex Shi <alex.shi@linaro.org>
Thu, 23 Mar 2017 07:39:23 +0000 (15:39 +0800)
commit351068f5efa8ae188bb1250eae0aa74060d493c8
treed416f315d014e6237e3f89ba979757e91a6b9ce4
parentfd0b2a599a78a04f3764d74fe34b112db78531db
fs/proc/kcore.c: Add bounce buffer for ktext data

We hit hardened usercopy feature check for kernel text access by reading
kcore file:

  usercopy: kernel memory exposure attempt detected from ffffffff8179a01f (<kernel text>) (4065 bytes)
  kernel BUG at mm/usercopy.c:75!

Bypassing this check for kcore by adding bounce buffer for ktext data.

Reported-by: Steve Best <sbest@redhat.com>
Fixes: f5509cc18daa ("mm: Hardened usercopy")
Suggested-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit df04abfd181acc276ba6762c8206891ae10ae00d)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
fs/proc/kcore.c