From: James Hogan <james.hogan@imgtec.com>
To: Kees Cook <keescook@chromium.org>
Cc: Ralf Baechle <ralf@linux-mips.org>,
"kernel-hardening@lists.openwall.com"
<kernel-hardening@lists.openwall.com>,
Linux MIPS Mailing List <linux-mips@linux-mips.org>,
Matt Redfearn <matt.redfearn@imgtec.com>,
Aaro Koskinen <aaro.koskinen@nokia.com>,
Masahiro Yamada <yamada.masahiro@socionext.com>,
Alexander Sverdlin <alexander.sverdlin@gmail.com>,
LKML <linux-kernel@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
David Daney <ddaney@caviumnetworks.com>,
Jaedon Shin <jaedon.shin@gmail.com>,
Jonas Gorski <jogo@openwrt.org>,
Paul Burton <paul.burton@imgtec.com>
Subject: Re: [kernel-hardening] [PATCH v2 00/11] MIPS relocatable kernel & KASLR
Date: Tue, 5 Apr 2016 22:00:29 +0100 [thread overview]
Message-ID: <20160405210029.GG31316@jhogan-linux.le.imgtec.org> (raw)
In-Reply-To: <CAGXu5jJ5B+MEg7SVgbmWju+y8XYnbunvfdR0ZD_tfz-u=iB03w@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2153 bytes --]
On Tue, Apr 05, 2016 at 11:10:40AM -0700, Kees Cook wrote:
> On Tue, Apr 5, 2016 at 2:09 AM, James Hogan <james.hogan@imgtec.com> wrote:
> > EVA (enhanced virtual addressing) is a feature present on recent MIPS
> > 32-bit i-class and p-class cores (and p6600 too which is 64-bit),
> > intended to make better use of 32-bit virtual address space. It can
> > actually overlap kernel and virtual address space, requiring special
> > instructions for accessing userland mappings, however each segment can't
> > have distinct TLB mappings for kernel and user mode (if kernel and user
> > view of segment differs, kernel would need to see it unmapped, i.e. a
> > window into physical memory). As such its generally better to keep the
> > lowest segment visible to both kernel and user, so that kernel NULL
> > dereferences can still be caught, which would negate the point of using
> > it for security. It is possible to make it work with watchpoints to
> > catch NULL dereferences in lowest 4KB, so kernel can't access any user
> > address space directly, but thats a bit of a hack really. Also since EVA
> > is aimed at making better use of 32-bit address space, it doesn't
> > address 64-bit.
>
> Ah, so it couldn't cover a 64-bit userspace range?
Correct.
<long version>
OTOH the segments that can be configured by EVA on MIPS64 (specifically
P6600 core) are:
0xffffffffe0000000..0xffffffffffffffff 512MB (normally kernel mapped)
0xffffffffc0000000..0xffffffffdfffffff 512MB (normally kernel mapped)
0xffffffffa0000000..0xffffffffbfffffff 512MB (normally kernel uncached)
0xffffffff80000000..0xffffffff9fffffff 512MB (normally kernel)
...
0x8000000000000000..0xbfffffffffffffff 8 64-bit unmapped segments (kern)
... <- MIPS64 extends user address space here
0x0000000040000000..0x000000007fffffff 1GB (normally user)
0x0000000000000000..0x000000003fffffff 1GB (normally user)
In the middle there, MIPS64 extends userspace from 0x0000000080000000
towards 0x4000000000000000 (depending on number of virtual address bits
implemented), over which there is no segmentation control.
</long version>
Cheers
James
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-04-05 21:00 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-31 9:05 [kernel-hardening] [PATCH v2 00/11] MIPS relocatable kernel & KASLR Matt Redfearn
2016-03-31 9:05 ` [kernel-hardening] [PATCH v2 01/11] MIPS: tools: Add relocs tool Matt Redfearn
2016-03-31 9:05 ` [kernel-hardening] [PATCH v2 02/11] MIPS: tools: Build " Matt Redfearn
2016-03-31 9:05 ` [kernel-hardening] [PATCH v2 03/11] MIPS: Reserve space for relocation table Matt Redfearn
2016-03-31 9:05 ` [kernel-hardening] [PATCH v2 04/11] MIPS: Generate relocation table when CONFIG_RELOCATABLE Matt Redfearn
2016-03-31 9:05 ` [kernel-hardening] [PATCH v2 05/11] MIPS: Kernel: Add relocate.c Matt Redfearn
2016-03-31 9:05 ` [kernel-hardening] [PATCH v2 06/11] MIPS: Call relocate_kernel if CONFIG_RELOCATABLE=y Matt Redfearn
2016-03-31 9:05 ` [kernel-hardening] [PATCH v2 07/11] MIPS: bootmem: When relocatable, free memory below kernel Matt Redfearn
2016-03-31 9:05 ` [kernel-hardening] [PATCH v2 08/11] MIPS: Add CONFIG_RELOCATABLE Kconfig option Matt Redfearn
2016-03-31 9:05 ` [kernel-hardening] [PATCH v2 09/11] MIPS: Introduce plat_get_fdt a platform API to retrieve the FDT Matt Redfearn
2016-03-31 9:05 ` [kernel-hardening] [PATCH v2 10/11] MIPS: Kernel: Implement KASLR using CONFIG_RELOCATABLE Matt Redfearn
2016-03-31 9:05 ` [kernel-hardening] [PATCH v2 11/11] MIPS: KASLR: Print relocation Information on boot Matt Redfearn
2016-03-31 12:38 ` [kernel-hardening] " Sergei Shtylyov
2016-04-01 8:44 ` Ralf Baechle
2016-04-01 9:07 ` Matt Redfearn
2016-04-04 19:46 ` [kernel-hardening] [PATCH v2 00/11] MIPS relocatable kernel & KASLR Kees Cook
2016-04-04 23:37 ` Ralf Baechle
2016-04-04 23:56 ` Kees Cook
2016-04-05 9:09 ` James Hogan
2016-04-05 18:10 ` Kees Cook
2016-04-05 21:00 ` James Hogan [this message]
2016-04-05 12:14 ` Maciej W. Rozycki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160405210029.GG31316@jhogan-linux.le.imgtec.org \
--to=james.hogan@imgtec.com \
--cc=aaro.koskinen@nokia.com \
--cc=alexander.sverdlin@gmail.com \
--cc=ddaney@caviumnetworks.com \
--cc=jaedon.shin@gmail.com \
--cc=jogo@openwrt.org \
--cc=keescook@chromium.org \
--cc=kernel-hardening@lists.openwall.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=matt.redfearn@imgtec.com \
--cc=paul.burton@imgtec.com \
--cc=ralf@linux-mips.org \
--cc=tglx@linutronix.de \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox