From: Kees Cook <keescook@chromium.org>
To: Chris Metcalf <cmetcalf@mellanox.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] tile: handle __ro_after_init like parisc does
Date: Mon, 14 Nov 2016 13:12:05 -0800 [thread overview]
Message-ID: <CAGXu5jLHwbGO3gu-_tpikt=WavRVv+5AAv_PDfFf_pKSbb1EKA@mail.gmail.com> (raw)
In-Reply-To: <1479155369-18074-1-git-send-email-cmetcalf@mellanox.com>
On Mon, Nov 14, 2016 at 12:29 PM, Chris Metcalf <cmetcalf@mellanox.com> wrote:
> The tile architecture already marks RO_DATA as read-only in
> the kernel, so grouping RO_AFTER_INIT_DATA with RO_DATA, as is
> done by default, means the kernel faults in init when it tries
> to write to RO_AFTER_INIT_DATA. For now, just arrange that
> __ro_after_init is handled like __write_once, i.e. __read_mostly.
>
> Signed-off-by: Chris Metcalf <cmetcalf@mellanox.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
At some point here, I want to collect all the arch maintainers and
discuss the options for correctly reflecting the three data
memory-protection needs we have:
- always read-only
- read-only after init
- read-only except during rare updates
(The latter one doesn't exist all yet...)
x86, arm, and arm64 use mark_rodata_ro() after init finishes, so they
don't technically implement "always read-only". parisc, tile, powerpc,
others have "always read-only", but disable read-only-after-init since
they don't use mark_rodata_ro(). I think s390 has recently implemented
both, but I have to double-check...
-Kees
> ---
> arch/tile/include/asm/cache.h | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/arch/tile/include/asm/cache.h b/arch/tile/include/asm/cache.h
> index 6160761d5f61..4810e48dbbbf 100644
> --- a/arch/tile/include/asm/cache.h
> +++ b/arch/tile/include/asm/cache.h
> @@ -61,4 +61,7 @@
> */
> #define __write_once __read_mostly
>
> +/* __ro_after_init is the generic name for the tile arch __write_once. */
> +#define __ro_after_init __read_mostly
> +
> #endif /* _ASM_TILE_CACHE_H */
> --
> 2.7.2
>
--
Kees Cook
Nexus Security
next prev parent reply other threads:[~2016-11-14 21:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-07 19:50 [PATCH] tile: handle RO_AFTER_INIT_DATA Chris Metcalf
2016-11-08 7:15 ` Heiko Carstens
2016-11-14 20:29 ` [PATCH v2] tile: handle __ro_after_init like parisc does Chris Metcalf
2016-11-14 21:12 ` Kees Cook [this message]
2016-11-15 7:41 ` Heiko Carstens
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='CAGXu5jLHwbGO3gu-_tpikt=WavRVv+5AAv_PDfFf_pKSbb1EKA@mail.gmail.com' \
--to=keescook@chromium.org \
--cc=cmetcalf@mellanox.com \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=schwidefsky@de.ibm.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;
as well as URLs for NNTP newsgroup(s).