Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1462705
| From | Catalin Marinas <catalin.marinas@arm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] arm64: Introduce execute-only page access permissions |
| Date | 2016-08-15 12:50 +0200 |
| Message-ID | <s6nCV-4sn-3@gated-at.bofh.it> (permalink) |
| References | <s52hb-6WI-5@gated-at.bofh.it> <s5pns-5ga-47@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, Aug 12, 2016 at 11:23:03AM -0700, Kees Cook wrote: > On Thu, Aug 11, 2016 at 10:44 AM, Catalin Marinas > <catalin.marinas@arm.com> wrote: > > The ARMv8 architecture allows execute-only user permissions by clearing > > the PTE_UXN and PTE_USER bits. However, the kernel running on a CPU > > implementation without User Access Override (ARMv8.2 onwards) can still > > access such page, so execute-only page permission does not protect > > against read(2)/write(2) etc. accesses. Systems requiring such > > protection must enable features like SECCOMP. > > So, UAO CPUs will bypass this protection in userspace if using > read/write on a memory-mapped file? It's the other way around. CPUs prior to ARMv8.2 (when UAO was introduced) or with the CONFIG_ARM64_UAO disabled can still access user execute-only memory regions while running in kernel mode via the copy_*_user, (get|put)_user etc. routines. So a way user can bypass this protection is by using such address as argument to read/write file operations. I don't think mmap() is an issue since such region is already mapped, so it would require mprotect(). As for the latter, it would most likely be restricted (probably together with read/write) SECCOMP. > I'm just trying to make sure I understand the bypass scenario. And is > this something that can be fixed? If we add exec-only, I feel like it > shouldn't have corner case surprises. :) I think we need better understanding of the usage scenarios for exec-only. IIUC (from those who first asked me for this feature), it is an additional protection on top of ASLR to prevent an untrusted entity from scanning the memory for ROP/JOP gadgets. An instrumented compiler would avoid generating the literal pool in the same section as the executable code, thus allowing the instructions to be mapped as executable-only. It's not clear to me how such untrusted code ends up scanning the memory, maybe relying on other pre-existent bugs (buffer under/overflows). I assume if such code is allowed to do system calls, all bets are off already. -- Catalin
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] arm64: Introduce execute-only page access permissions Catalin Marinas <catalin.marinas@arm.com> - 2016-08-11 19:50 +0200
Re: [PATCH] arm64: Introduce execute-only page access permissions Kees Cook <keescook@chromium.org> - 2016-08-12 20:30 +0200
Re: [PATCH] arm64: Introduce execute-only page access permissions Catalin Marinas <catalin.marinas@arm.com> - 2016-08-15 12:50 +0200
Re: [PATCH] arm64: Introduce execute-only page access permissions Kees Cook <keescook@chromium.org> - 2016-08-15 19:50 +0200
Re: [PATCH] arm64: Introduce execute-only page access permissions Catalin Marinas <catalin.marinas@arm.com> - 2016-08-16 18:30 +0200
csiph-web