UPSTREAM: 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)
committerAmit Pundir <amit.pundir@linaro.org>
Wed, 12 Oct 2016 12:04:22 +0000 (17:34 +0530)
commit816619eef35db278af3706b4cf3747ff3739cc6f
tree65a3b4293a0ff678d1a474b0605a2ab599233de6
parentac8c3e015085f20829198156eaf3ce6d3cfbebd1
UPSTREAM: 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>
Bug: 31374226
Change-Id: Ic93e6041b67d804a994518bf4950811f828b406e
(cherry picked from commit df04abfd181acc276ba6762c8206891ae10ae00d)
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
fs/proc/kcore.c