From: Mark Rutland <mark.rutland@arm.com>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: linux-arm-kernel@lists.infradead.org, keescook@chromium.org,
ard.biesheuvel@linaro.org, matt@codeblueprint.co.uk,
kernel-hardening@lists.openwall.com, will.deacon@arm.com,
linux-kernel@vger.kernel.org, luto@amacapital.net,
james.morse@arm.com, labbott@redhat.com
Subject: [kernel-hardening] Re: [PATCH 05/14] arm64: clean up THREAD_* definitions
Date: Mon, 14 Aug 2017 14:10:24 +0100 [thread overview]
Message-ID: <20170814131023.GA23428@leverpostej> (raw)
In-Reply-To: <20170814115958.dqg2xrobls4jcgx3@armageddon.cambridge.arm.com>
On Mon, Aug 14, 2017 at 12:59:59PM +0100, Catalin Marinas wrote:
> On Mon, Aug 07, 2017 at 07:35:56PM +0100, Mark Rutland wrote:
> > Currently we define THREAD_SIZE and THREAD_SIZE order separately, with
>
> s/THREAD_SIZE order/THREAD_SIZE_ORDER/
Whoops; I'll fix that up now.
> > +#define THREAD_SHIFT 14
> > +
> > +#if THREAD_SHIFT >= PAGE_SHIFT
> > +#define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT)
> > +#endif
> > +
> > +#define THREAD_SIZE (UL(1) << THREAD_SHIFT)
>
> I haven't tried the series to this patch but it seems to me that
> THREAD_SIZE_ORDER is undefined for a PAGE_SHIFT of 16.
That is already the case without these patches, as we have:
#ifdef CONFIG_ARM64_4K_PAGES
#define THREAD_SIZE_ORDER 2
#elif defined(CONFIG_ARM64_16K_PAGES)
#define THREAD_SIZE_ORDER 0
#endif
... this is also deliberate, as we'd need an order of -2 with 16K stacks and
64K pages, and this doesn't make sense.
THREAD_SIZE_ORDER only matters if THREAD_SIZE >= PAGE_SIZE (or if we're using a
VMAP'd stack). For 64K pages && VMAP_STACK, we'll use a 64K stack, avoiding the
problem.
Thanks,
Mark.
WARNING: multiple messages have this Message-ID (diff)
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 05/14] arm64: clean up THREAD_* definitions
Date: Mon, 14 Aug 2017 14:10:24 +0100 [thread overview]
Message-ID: <20170814131023.GA23428@leverpostej> (raw)
In-Reply-To: <20170814115958.dqg2xrobls4jcgx3@armageddon.cambridge.arm.com>
On Mon, Aug 14, 2017 at 12:59:59PM +0100, Catalin Marinas wrote:
> On Mon, Aug 07, 2017 at 07:35:56PM +0100, Mark Rutland wrote:
> > Currently we define THREAD_SIZE and THREAD_SIZE order separately, with
>
> s/THREAD_SIZE order/THREAD_SIZE_ORDER/
Whoops; I'll fix that up now.
> > +#define THREAD_SHIFT 14
> > +
> > +#if THREAD_SHIFT >= PAGE_SHIFT
> > +#define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT)
> > +#endif
> > +
> > +#define THREAD_SIZE (UL(1) << THREAD_SHIFT)
>
> I haven't tried the series to this patch but it seems to me that
> THREAD_SIZE_ORDER is undefined for a PAGE_SHIFT of 16.
That is already the case without these patches, as we have:
#ifdef CONFIG_ARM64_4K_PAGES
#define THREAD_SIZE_ORDER 2
#elif defined(CONFIG_ARM64_16K_PAGES)
#define THREAD_SIZE_ORDER 0
#endif
... this is also deliberate, as we'd need an order of -2 with 16K stacks and
64K pages, and this doesn't make sense.
THREAD_SIZE_ORDER only matters if THREAD_SIZE >= PAGE_SIZE (or if we're using a
VMAP'd stack). For 64K pages && VMAP_STACK, we'll use a 64K stack, avoiding the
problem.
Thanks,
Mark.
WARNING: multiple messages have this Message-ID (diff)
From: Mark Rutland <mark.rutland@arm.com>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: linux-arm-kernel@lists.infradead.org, keescook@chromium.org,
ard.biesheuvel@linaro.org, matt@codeblueprint.co.uk,
kernel-hardening@lists.openwall.com, will.deacon@arm.com,
linux-kernel@vger.kernel.org, luto@amacapital.net,
james.morse@arm.com, labbott@redhat.com
Subject: Re: [PATCH 05/14] arm64: clean up THREAD_* definitions
Date: Mon, 14 Aug 2017 14:10:24 +0100 [thread overview]
Message-ID: <20170814131023.GA23428@leverpostej> (raw)
In-Reply-To: <20170814115958.dqg2xrobls4jcgx3@armageddon.cambridge.arm.com>
On Mon, Aug 14, 2017 at 12:59:59PM +0100, Catalin Marinas wrote:
> On Mon, Aug 07, 2017 at 07:35:56PM +0100, Mark Rutland wrote:
> > Currently we define THREAD_SIZE and THREAD_SIZE order separately, with
>
> s/THREAD_SIZE order/THREAD_SIZE_ORDER/
Whoops; I'll fix that up now.
> > +#define THREAD_SHIFT 14
> > +
> > +#if THREAD_SHIFT >= PAGE_SHIFT
> > +#define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT)
> > +#endif
> > +
> > +#define THREAD_SIZE (UL(1) << THREAD_SHIFT)
>
> I haven't tried the series to this patch but it seems to me that
> THREAD_SIZE_ORDER is undefined for a PAGE_SHIFT of 16.
That is already the case without these patches, as we have:
#ifdef CONFIG_ARM64_4K_PAGES
#define THREAD_SIZE_ORDER 2
#elif defined(CONFIG_ARM64_16K_PAGES)
#define THREAD_SIZE_ORDER 0
#endif
... this is also deliberate, as we'd need an order of -2 with 16K stacks and
64K pages, and this doesn't make sense.
THREAD_SIZE_ORDER only matters if THREAD_SIZE >= PAGE_SIZE (or if we're using a
VMAP'd stack). For 64K pages && VMAP_STACK, we'll use a 64K stack, avoiding the
problem.
Thanks,
Mark.
next prev parent reply other threads:[~2017-08-14 13:10 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-07 18:35 [kernel-hardening] [PATCH 00/14] arm64: VMAP_STACK support Mark Rutland
2017-08-07 18:35 ` Mark Rutland
2017-08-07 18:35 ` Mark Rutland
2017-08-07 18:35 ` [kernel-hardening] [PATCH 01/14] arm64: remove __die()'s stack dump Mark Rutland
2017-08-07 18:35 ` Mark Rutland
2017-08-07 18:35 ` Mark Rutland
2017-08-07 18:35 ` [kernel-hardening] [PATCH 02/14] fork: allow arch-override of VMAP stack alignment Mark Rutland
2017-08-07 18:35 ` Mark Rutland
2017-08-07 18:35 ` Mark Rutland
2017-08-07 18:35 ` [kernel-hardening] [PATCH 03/14] arm64: kernel: remove {THREAD,IRQ_STACK}_START_SP Mark Rutland
2017-08-07 18:35 ` Mark Rutland
2017-08-07 18:35 ` Mark Rutland
2017-08-07 18:35 ` [kernel-hardening] [PATCH 04/14] arm64: factor out PAGE_* and CONT_* definitions Mark Rutland
2017-08-07 18:35 ` Mark Rutland
2017-08-07 18:35 ` Mark Rutland
2017-08-07 18:35 ` [kernel-hardening] [PATCH 05/14] arm64: clean up THREAD_* definitions Mark Rutland
2017-08-07 18:35 ` Mark Rutland
2017-08-07 18:35 ` Mark Rutland
2017-08-14 11:59 ` [kernel-hardening] " Catalin Marinas
2017-08-14 11:59 ` Catalin Marinas
2017-08-14 11:59 ` Catalin Marinas
2017-08-14 13:10 ` Mark Rutland [this message]
2017-08-14 13:10 ` Mark Rutland
2017-08-14 13:10 ` Mark Rutland
2017-08-07 18:35 ` [kernel-hardening] [PATCH 06/14] arm64: clean up irq stack definitions Mark Rutland
2017-08-07 18:35 ` Mark Rutland
2017-08-07 18:35 ` Mark Rutland
2017-08-07 18:35 ` [kernel-hardening] [PATCH 07/14] arm64: move SEGMENT_ALIGN to <asm/memory.h> Mark Rutland
2017-08-07 18:35 ` Mark Rutland
2017-08-07 18:35 ` Mark Rutland
2017-08-07 18:35 ` [kernel-hardening] [PATCH 08/14] efi/arm64: add EFI_KIMG_ALIGN Mark Rutland
2017-08-07 18:35 ` Mark Rutland
2017-08-07 18:35 ` Mark Rutland
2017-08-07 18:36 ` [kernel-hardening] [PATCH 09/14] arm64: factor out entry stack manipulation Mark Rutland
2017-08-07 18:36 ` Mark Rutland
2017-08-07 18:36 ` Mark Rutland
2017-08-07 18:36 ` [kernel-hardening] [PATCH 10/14] arm64: assembler: allow adr_this_cpu to use the stack pointer Mark Rutland
2017-08-07 18:36 ` Mark Rutland
2017-08-07 18:36 ` Mark Rutland
2017-08-14 17:13 ` [kernel-hardening] " Catalin Marinas
2017-08-14 17:13 ` Catalin Marinas
2017-08-14 17:13 ` Catalin Marinas
2017-08-14 17:42 ` [kernel-hardening] " Mark Rutland
2017-08-14 17:42 ` Mark Rutland
2017-08-14 17:42 ` Mark Rutland
2017-08-07 18:36 ` [kernel-hardening] [PATCH 11/14] arm64: use an irq " Mark Rutland
2017-08-07 18:36 ` Mark Rutland
2017-08-07 18:36 ` Mark Rutland
2017-08-07 18:36 ` [kernel-hardening] [PATCH 12/14] arm64: add basic VMAP_STACK support Mark Rutland
2017-08-07 18:36 ` Mark Rutland
2017-08-07 18:36 ` Mark Rutland
2017-08-07 18:36 ` [kernel-hardening] [PATCH 13/14] arm64: add on_accessible_stack() Mark Rutland
2017-08-07 18:36 ` Mark Rutland
2017-08-07 18:36 ` Mark Rutland
2017-08-07 18:36 ` [kernel-hardening] [PATCH 14/14] arm64: add VMAP_STACK overflow detection Mark Rutland
2017-08-07 18:36 ` Mark Rutland
2017-08-07 18:36 ` Mark Rutland
2017-08-14 15:32 ` [kernel-hardening] " Will Deacon
2017-08-14 15:32 ` Will Deacon
2017-08-14 15:32 ` Will Deacon
2017-08-14 17:25 ` [kernel-hardening] " Mark Rutland
2017-08-14 17:25 ` Mark Rutland
2017-08-14 17:25 ` Mark Rutland
2017-08-15 11:10 ` [kernel-hardening] " Catalin Marinas
2017-08-15 11:10 ` Catalin Marinas
2017-08-15 11:10 ` Catalin Marinas
2017-08-15 11:19 ` [kernel-hardening] " Mark Rutland
2017-08-15 11:19 ` Mark Rutland
2017-08-15 11:19 ` Mark Rutland
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=20170814131023.GA23428@leverpostej \
--to=mark.rutland@arm.com \
--cc=ard.biesheuvel@linaro.org \
--cc=catalin.marinas@arm.com \
--cc=james.morse@arm.com \
--cc=keescook@chromium.org \
--cc=kernel-hardening@lists.openwall.com \
--cc=labbott@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=matt@codeblueprint.co.uk \
--cc=will.deacon@arm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.