Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1478517
| From | Kees Cook <keescook@chromium.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] fs/proc/kcore.c: Omit kernel text area for hardened usercopy feature |
| Date | 2016-09-07 19:20 +0200 |
| Message-ID | <seOFY-2Bs-9@gated-at.bofh.it> (permalink) |
| References | (2 earlier) <sdXLk-1lQ-5@gated-at.bofh.it> <sesPd-55p-11@gated-at.bofh.it> <setrQ-5CI-45@gated-at.bofh.it> <seuxz-6eZ-7@gated-at.bofh.it> <seuxA-6eZ-27@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue, Sep 6, 2016 at 12:48 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Tue, Sep 6, 2016 at 12:41 PM, Andi Kleen <andi@firstfloor.org> wrote:
>>
>> I suspect it's more than just /proc/kcore, there could be also
>> legitimate cases to read kernel text from /dev/mem or /dev/kmem
>
> Yes, that's probably true. Although I suspect that we should just say
> that user-copy hardening is incompatible with /dev/kmem and
> !STRICT_DEVMEM.
>
> At least Fedora seems to have
>
> CONFIG_DEVMEM=y
> # CONFIG_DEVKMEM is not set
> CONFIG_STRICT_DEVMEM=y
>
> which should mean that you already should not be able to access normal
> RAM using /dev/[k]mem - ie it's purely for legacy X server kind of
> situations.
>
> So we could just make HARDENED_USERCOPY force those settings. It's
> not like you should ever have anything else in any situation where you
> care about security *anyway*, so...
!DEVKMEM is easy to represent, but STRICT_DEVMEM=y gets a little ugly,
since the logic desired is actually "STRICT_DEVMEM=y if STRICT_DEVMEM
available" and STRICT_DEVMEM looks like this:
config STRICT_DEVMEM
bool "Filter access to /dev/mem"
depends on MMU
depends on ARCH_HAS_DEVMEM_IS_ALLOWED
But I don't want to limit hardened usercopy to MMU only, so...
depends on !DEVKMEM
depends on STRICT_DEVMEM=y || !ARCH_HAS_DEVMEM_IS_ALLOWED || !MMU
This looks a bit ugly to me, but I'm happy to add it if people think
it's worth it.
-Kees
--
Kees Cook
Nexus Security
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] fs/proc/kcore.c: Omit kernel text area for hardened usercopy feature Jiri Olsa <jolsa@kernel.org> - 2016-09-02 14:30 +0200
Re: [PATCH] fs/proc/kcore.c: Omit kernel text area for hardened usercopy feature Andi Kleen <andi@firstfloor.org> - 2016-09-02 17:20 +0200
Re: [PATCH] fs/proc/kcore.c: Omit kernel text area for hardened usercopy feature Jiri Olsa <jolsa@redhat.com> - 2016-09-02 18:20 +0200
Re: [PATCH] fs/proc/kcore.c: Omit kernel text area for hardened usercopy feature Jiri Olsa <jolsa@redhat.com> - 2016-09-05 10:50 +0200
Re: [PATCH] fs/proc/kcore.c: Omit kernel text area for hardened usercopy feature Andi Kleen <andi@firstfloor.org> - 2016-09-05 18:30 +0200
Re: [PATCH] fs/proc/kcore.c: Omit kernel text area for hardened usercopy feature Kees Cook <keescook@chromium.org> - 2016-09-06 20:00 +0200
Re: [PATCH] fs/proc/kcore.c: Omit kernel text area for hardened usercopy feature Linus Torvalds <torvalds@linux-foundation.org> - 2016-09-06 20:40 +0200
Re: [PATCH] fs/proc/kcore.c: Omit kernel text area for hardened usercopy feature Andi Kleen <andi@firstfloor.org> - 2016-09-06 21:50 +0200
Re: [PATCH] fs/proc/kcore.c: Omit kernel text area for hardened usercopy feature Linus Torvalds <torvalds@linux-foundation.org> - 2016-09-06 21:50 +0200
Re: [PATCH] fs/proc/kcore.c: Omit kernel text area for hardened usercopy feature Kees Cook <keescook@chromium.org> - 2016-09-07 19:20 +0200
Re: [PATCH] fs/proc/kcore.c: Omit kernel text area for hardened usercopy feature Linus Torvalds <torvalds@linux-foundation.org> - 2016-09-07 19:30 +0200
Re: [PATCH] fs/proc/kcore.c: Omit kernel text area for hardened usercopy feature Jiri Olsa <jolsa@redhat.com> - 2016-09-07 09:40 +0200
Re: [PATCH] fs/proc/kcore.c: Omit kernel text area for hardened usercopy feature Andi Kleen <andi@firstfloor.org> - 2016-09-07 18:40 +0200
Re: [PATCH] fs/proc/kcore.c: Omit kernel text area for hardened usercopy feature Linus Torvalds <torvalds@linux-foundation.org> - 2016-09-07 19:00 +0200
Re: [PATCH] fs/proc/kcore.c: Omit kernel text area for hardened usercopy feature Jiri Olsa <jolsa@redhat.com> - 2016-09-07 21:30 +0200
Re: [PATCH] fs/proc/kcore.c: Omit kernel text area for hardened usercopy feature Jiri Olsa <jolsa@redhat.com> - 2016-09-07 23:30 +0200
Re: [PATCH] fs/proc/kcore.c: Omit kernel text area for hardened usercopy feature Linus Torvalds <torvalds@linux-foundation.org> - 2016-09-08 01:00 +0200
csiph-web