All of lore.kernel.org
 help / color / mirror / Atom feed
From: rabin@rab.in (Rabin Vincent)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] arm: use fixmap for text patching when text is RO
Date: Thu, 10 Apr 2014 21:34:46 +0200	[thread overview]
Message-ID: <20140410193433.GA22746@debian> (raw)
In-Reply-To: <1396879071.3654.43.camel@linaro1.home>

On Mon, Apr 07, 2014 at 02:57:51PM +0100, Jon Medhurst (Tixy) wrote:
> How does fixmap cope with cache colouring? Looking at the implementation
> it looks like it doesn't and so fixmap use on ARM is possibly buggy.
> 
> For the text patching case where we know there are no writeable mappings
> [1] this should be OK if we used set_fixmap_nocache here, so long as we
> also invalidated the dcache later for the proper virtual address.

OK.  The dcache invalidation for the proper virtual address is btw
already there via the call to flush_icache_range().

> [1] Can we know there are no writeable mappings though, the ftrace code
> modifying patches from Kees Cook have there own way of modifying text
> code permissions.

The ftrace patches does the modifications and the cache cleaning in
stop_machine(), so there should not be any dirty cache lines from those
writable mappings when we set up and write to these fixmaps.  Do you
still see a problem?

WARNING: multiple messages have this Message-ID (diff)
From: Rabin Vincent <rabin@rab.in>
To: "Jon Medhurst (Tixy)" <tixy@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Kees Cook <keescook@chromium.org>,
	Laura Abbott <lauraa@codeaurora.org>
Subject: Re: [PATCH 2/2] arm: use fixmap for text patching when text is RO
Date: Thu, 10 Apr 2014 21:34:46 +0200	[thread overview]
Message-ID: <20140410193433.GA22746@debian> (raw)
In-Reply-To: <1396879071.3654.43.camel@linaro1.home>

On Mon, Apr 07, 2014 at 02:57:51PM +0100, Jon Medhurst (Tixy) wrote:
> How does fixmap cope with cache colouring? Looking at the implementation
> it looks like it doesn't and so fixmap use on ARM is possibly buggy.
> 
> For the text patching case where we know there are no writeable mappings
> [1] this should be OK if we used set_fixmap_nocache here, so long as we
> also invalidated the dcache later for the proper virtual address.

OK.  The dcache invalidation for the proper virtual address is btw
already there via the call to flush_icache_range().

> [1] Can we know there are no writeable mappings though, the ftrace code
> modifying patches from Kees Cook have there own way of modifying text
> code permissions.

The ftrace patches does the modifications and the cache cleaning in
stop_machine(), so there should not be any dirty cache lines from those
writable mappings when we set up and write to these fixmaps.  Do you
still see a problem?

  parent reply	other threads:[~2014-04-10 19:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-04 21:27 [PATCH 1/2] arm: fixmap: implement __set_fixmap() Rabin Vincent
2014-04-04 21:27 ` Rabin Vincent
2014-04-04 21:27 ` [PATCH 2/2] arm: use fixmap for text patching when text is RO Rabin Vincent
2014-04-04 21:27   ` Rabin Vincent
2014-04-07 13:57   ` Jon Medhurst (Tixy)
2014-04-07 13:57     ` Jon Medhurst (Tixy)
2014-04-07 18:04     ` Kees Cook
2014-04-07 18:04       ` Kees Cook
2014-04-08  9:31       ` Jon Medhurst (Tixy)
2014-04-08  9:31         ` Jon Medhurst (Tixy)
2014-04-10 19:34     ` Rabin Vincent [this message]
2014-04-10 19:34       ` Rabin Vincent
2014-04-23 21:09   ` Kees Cook
2014-04-23 21:09     ` Kees Cook
2014-04-23 22:51     ` Doug Anderson
2014-04-23 22:51       ` Doug Anderson
2014-04-24 21:28   ` [PATCHv2 " Rabin Vincent
2014-04-24 21:28     ` Rabin Vincent
2014-04-25  0:52 ` [PATCH 1/2] arm: fixmap: implement __set_fixmap() Doug Anderson
2014-04-25  0:52   ` Doug Anderson

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=20140410193433.GA22746@debian \
    --to=rabin@rab.in \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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.