From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Jordan Niethe <jniethe5@gmail.com>,
Michael Ellerman <mpe@ellerman.id.au>
Cc: ajd@linux.ibm.com, Kees Cook <keescook@chromium.org>,
Nicholas Piggin <npiggin@gmail.com>,
cmr@codefail.de, naveen.n.rao@linux.ibm.com,
linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
Daniel Axtens <dja@axtens.net>
Subject: Re: [PATCH v10 06/10] powerpc/mm/ptdump: debugfs handler for W+X checks at runtime
Date: Wed, 21 Apr 2021 07:16:16 +0200 [thread overview]
Message-ID: <825f6dc7-637a-dab3-f659-db5b62a9f73d@csgroup.eu> (raw)
In-Reply-To: <CACzsE9pgZRaoHT0Ca=NB3srEMJMvLuiFkYA98xFDiUPyfmoV5Q@mail.gmail.com>
Le 21/04/2021 à 04:23, Jordan Niethe a écrit :
> On Wed, Mar 31, 2021 at 10:24 PM Michael Ellerman <mpe@ellerman.id.au> wrote:
>>
>> Jordan Niethe <jniethe5@gmail.com> writes:
>>> From: Russell Currey <ruscur@russell.cc>
>>>
>>> Optionally run W+X checks when dumping pagetable information to
>>> debugfs' kernel_page_tables.
>>>
>>> To use:
>>> $ echo 1 > /sys/kernel/debug/check_wx_pages
>>> $ cat /sys/kernel/debug/kernel_page_tables
>>>
>>> and check the kernel log. Useful for testing strict module RWX.
>>>
>>> To disable W+X checks:
>>> $ echo 0 > /sys/kernel/debug/check_wx_pages
>>>
>>> Update the Kconfig entry to reflect this.
>>>
>>> Also fix a typo.
>>>
>>> Reviewed-by: Kees Cook <keescook@chromium.org>
>>> Signed-off-by: Russell Currey <ruscur@russell.cc>
>>> [jpn: Change check_wx_pages to act as mode bit affecting
>>> kernel_page_tables instead of triggering action on its own]
>>> Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
>>> ---
>>> v10: check_wx_pages now affects kernel_page_tables rather then triggers
>>> its own action.
>>
>> Hmm. I liked the old version better :)
>>
>> I think you changed it based on Christophe's comment:
>>
>> Why not just perform the test everytime someone dumps kernel_page_tables ?
>>
>>
>> But I think he meant *always* do the check when someone dumps
>> kernel_page_tables, not have another file to enable checking and then
>> require someone to dump kernel_page_tables to do the actual check.
> Yes, I guess I misinterpreted that.
>>
>> Still I like the previous version where you can do the checks
>> separately, without having to dump the page tables, because dumping can
>> sometimes take quite a while.
>>
>> What would be even better is if ptdump_check_wx() returned an error when
>> wx pages were found, and that was plumbed out to the debugs file. That
>> way you can script around it.
> Ok I'll go back to how it was and add in returning an error.
I have a series to convert PPC_PTDUMP into GENERIC_PTDUMP, see
https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=239795
>>
>> cheers
next prev parent reply other threads:[~2021-04-21 5:16 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-30 4:51 [PATCH v10 00/10] powerpc: Further Strict RWX support Jordan Niethe
2021-03-30 4:51 ` [PATCH v10 01/10] powerpc/mm: Implement set_memory() routines Jordan Niethe
2021-03-30 5:16 ` Christophe Leroy
2021-04-21 2:51 ` Jordan Niethe
2021-03-31 11:16 ` Michael Ellerman
2021-03-31 12:03 ` Christophe Leroy
2021-04-21 5:03 ` Jordan Niethe
2021-04-01 4:37 ` Aneesh Kumar K.V
2021-04-21 5:19 ` Jordan Niethe
2021-03-30 4:51 ` [PATCH v10 02/10] powerpc/lib/code-patching: Set up Strict RWX patching earlier Jordan Niethe
2021-03-30 4:51 ` [PATCH v10 03/10] powerpc: Always define MODULES_{VADDR,END} Jordan Niethe
2021-03-30 5:00 ` Christophe Leroy
2021-04-01 13:36 ` Christophe Leroy
2021-04-21 2:46 ` Jordan Niethe
2021-04-21 5:14 ` Christophe Leroy
2021-04-21 5:22 ` Jordan Niethe
2021-03-30 4:51 ` [PATCH v10 04/10] powerpc/kprobes: Mark newly allocated probes as ROX Jordan Niethe
2021-03-30 5:05 ` Christophe Leroy
2021-04-21 2:39 ` Jordan Niethe
2021-03-30 4:51 ` [PATCH v10 05/10] powerpc/bpf: Write protect JIT code Jordan Niethe
2021-03-31 10:37 ` Michael Ellerman
2021-03-31 10:39 ` Christophe Leroy
2021-04-21 2:35 ` Jordan Niethe
2021-04-21 6:51 ` Michael Ellerman
2021-03-30 4:51 ` [PATCH v10 06/10] powerpc/mm/ptdump: debugfs handler for W+X checks at runtime Jordan Niethe
2021-03-31 11:24 ` Michael Ellerman
2021-04-21 2:23 ` Jordan Niethe
2021-04-21 5:16 ` Christophe Leroy [this message]
2021-03-30 4:51 ` [PATCH v10 07/10] powerpc: Set ARCH_HAS_STRICT_MODULE_RWX Jordan Niethe
2021-03-30 4:51 ` [PATCH v10 08/10] powerpc/configs: Enable STRICT_MODULE_RWX in skiroot_defconfig Jordan Niethe
2021-03-30 5:27 ` Christophe Leroy
2021-04-21 2:37 ` Jordan Niethe
2021-03-30 4:51 ` [PATCH v10 09/10] powerpc/mm: implement set_memory_attr() Jordan Niethe
2021-03-30 4:51 ` [PATCH v10 10/10] powerpc/32: use set_memory_attr() Jordan Niethe
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=825f6dc7-637a-dab3-f659-db5b62a9f73d@csgroup.eu \
--to=christophe.leroy@csgroup.eu \
--cc=ajd@linux.ibm.com \
--cc=cmr@codefail.de \
--cc=dja@axtens.net \
--cc=jniethe5@gmail.com \
--cc=keescook@chromium.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=naveen.n.rao@linux.ibm.com \
--cc=npiggin@gmail.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).