linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Laura Abbott <labbott@redhat.com>
Cc: Laura Abbott <labbott@fedoraproject.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Xishi Qiu <qiuxishi@huawei.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Mark Rutland <mark.rutland@arm.com>
Subject: Re: [PATCH 0/2] Support for set_memory_* outside of module space
Date: Wed, 4 Nov 2015 11:06:19 -0800	[thread overview]
Message-ID: <CAGXu5j+p2iLDJXVQLoXYzt3jWYEcgQW8XhPRMHcyOYfx==VhSg@mail.gmail.com> (raw)
In-Reply-To: <563A53CB.8000103@redhat.com>

On Wed, Nov 4, 2015 at 10:51 AM, Laura Abbott <labbott@redhat.com> wrote:
> On 11/03/2015 03:42 PM, Kees Cook wrote:
>>
>> On Tue, Nov 3, 2015 at 1:48 PM, Laura Abbott <labbott@fedoraproject.org>
>> wrote:
>>>
>>>
>>> Hi,
>>>
>>> Based on a recent discussion[1] there is interest in having set_memory_*
>>> work
>>> on kernel memory for security and other use cases. This patch adds the
>>> ability for that to happen behind a kernel option. If this is welcome
>>> enough,
>>> the Kconfig can be dropped. This has been briefly tested but not stress
>>> tested.
>>>
>>> Thanks,
>>> Laura
>>>
>>> [1]
>>> http://lists.infradead.org/pipermail/linux-arm-kernel/2015-October/382079.html
>>>
>>> Laura Abbott (2):
>>>    arm64: Get existing page protections in split_pmd
>>>    arm64: Allow changing of attributes outside of modules
>>>
>>>   arch/arm64/Kconfig.debug | 11 +++++++
>>>   arch/arm64/mm/mm.h       |  3 ++
>>>   arch/arm64/mm/mmu.c      | 11 ++++---
>>>   arch/arm64/mm/pageattr.c | 74
>>> ++++++++++++++++++++++++++++++++++++++++++++----
>>>   4 files changed, 88 insertions(+), 11 deletions(-)
>>
>>
>> This seems like the right thing to have. What's arm64 doing for the
>> equivalent of x86 and arm's set_kernel_text_* functions? x86 and arm
>> call their set_memory_* functions, for example. A quick examination
>> shows mm/mmu.c is just doing it "by hand" in fixup_executable and
>> mark_rodata_ro? Could those functions use the new set_memory_* ones?
>>
>
> It looks like mark_rodata_ro could probably use the set_memory_ro. I'll
> have to test it out. Longer term, the page table setup code should
> probably just be pulled out into a common file.
>
> Do you know the code path in ftrace which would trigger the
> set_kernel_text_*
> If not, I'll go  see if I can figure out if it's implemented yet on arm64.

Looking now, it seems that things like jump label use
aarch64_insn_patch_text, which ultimately call down to
__aarch64_insn_write(), which is using the fixmap via FIX_TEXT_POKE0.

-Kees

-- 
Kees Cook
Chrome OS Security

      reply	other threads:[~2015-11-04 19:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-03 21:48 [PATCH 0/2] Support for set_memory_* outside of module space Laura Abbott
2015-11-03 21:48 ` [PATCH 1/2] arm64: Get existing page protections in split_pmd Laura Abbott
2015-11-05  7:07   ` Ard Biesheuvel
2015-11-05 10:15   ` Xishi Qiu
2015-11-06  1:24     ` Laura Abbott
2015-11-03 21:48 ` [PATCH 2/2] arm64: Allow changing of attributes outside of modules Laura Abbott
2015-11-04  3:17   ` zhong jiang
2015-11-05  7:44   ` Ard Biesheuvel
2015-11-06  1:35     ` Laura Abbott
     [not found]   ` <563974A8.3060306@huawei.com>
     [not found]     ` <563A4A74.60900@redhat.com>
2015-11-05 11:10       ` Xishi Qiu
2015-11-06  1:11         ` Laura Abbott
2015-11-05 11:29   ` Xishi Qiu
2015-11-03 23:42 ` [PATCH 0/2] Support for set_memory_* outside of module space Kees Cook
2015-11-04 18:51   ` Laura Abbott
2015-11-04 19:06     ` Kees Cook [this message]

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='CAGXu5j+p2iLDJXVQLoXYzt3jWYEcgQW8XhPRMHcyOYfx==VhSg@mail.gmail.com' \
    --to=keescook@chromium.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=catalin.marinas@arm.com \
    --cc=labbott@fedoraproject.org \
    --cc=labbott@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=qiuxishi@huawei.com \
    --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 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).