Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1607871

Re: [PATCH v5 1/4] syscalls: Restore address limit after a syscall

From Kees Cook <keescook@chromium.org>
Newsgroups linux.kernel
Subject Re: [PATCH v5 1/4] syscalls: Restore address limit after a syscall
Date 2017-03-23 21:20 +0100
Message-ID <tohnc-7os-11@gated-at.bofh.it> (permalink)
References <toeIF-5py-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Mar 23, 2017 at 10:25 AM, Thomas Garnier <thgarnie@google.com> wrote:
> This patch ensures a syscall does not return to user-mode with a kernel
> address limit. If that happened, a process can corrupt kernel-mode
> memory and elevate privileges.
>
> For example, it would mitigation this bug:
>
> - https://bugs.chromium.org/p/project-zero/issues/detail?id=990
>
> The CONFIG_ARCH_NO_SYSCALL_VERIFY_PRE_USERMODE_STATE option is also
> added so each architecture can optimize this change.
>
> Signed-off-by: Thomas Garnier <thgarnie@google.com>

Awesome. :) I've tested this on x86 and arm with the LKDTM patch I'll
post in a moment.

[   46.977823] lkdtm: Performing direct entry CORRUPT_USER_DS
[   46.978966] lkdtm: setting bad task size limit
[   46.980302] ------------[ cut here ]------------
[   46.981219] kernel BUG at ./include/linux/syscalls.h:200!

Tested-by: Kees Cook <keescook@chromium.org>

(Also note, your Signed-off-by lines are missing in patches 2-4)

-- 
Kees Cook
Pixel Security

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v5 1/4] syscalls: Restore address limit after a syscall Thomas Garnier <thgarnie@google.com> - 2017-03-23 18:30 +0100
  [PATCH v5 4/4] arm64/syscalls: Specific usage of verify_pre_usermode_state Thomas Garnier <thgarnie@google.com> - 2017-03-23 18:30 +0100
    Re: [PATCH v5 4/4] arm64/syscalls: Specific usage of verify_pre_usermode_state Thomas Garnier <thgarnie@google.com> - 2017-03-23 21:40 +0100
  Re: [PATCH v5 1/4] syscalls: Restore address limit after a syscall Kees Cook <keescook@chromium.org> - 2017-03-23 21:20 +0100

csiph-web