From: Rusty Russell <rusty@rustcorp.com.au>
To: Josh Poimboeuf <jpoimboe@redhat.com>,
Seth Jennings <sjenning@redhat.com>,
Jiri Kosina <jikos@kernel.org>, Vojtech Pavlik <vojtech@suse.com>
Cc: linux-kernel@vger.kernel.org, live-patching@vger.kernel.org,
"Cyril B." <cbay@alwaysdata.com>, Miroslav Benes <mbenes@suse.cz>
Subject: Re: [PATCH v2 2/3] module: Use the same logic for setting and unsetting RO/NX
Date: Mon, 09 Nov 2015 06:10:45 +1030 [thread overview]
Message-ID: <87d1vk2saq.fsf@rustcorp.com.au> (raw)
In-Reply-To: <dca4b50303a3a4895b0a095b2bba2ab2f23ccfc9.1446757977.git.jpoimboe@redhat.com>
Josh Poimboeuf <jpoimboe@redhat.com> writes:
> When setting a module's RO and NX permissions, set_section_ro_nx() is
> used, but when clearing them, unset_module_{init,core}_ro_nx() are used.
> The unset functions don't have the same checks the set function has for
> partial page protections. It's probably harmless, but it's still
> confusingly asymmetrical.
>
> Instead, use the same logic to do both. Also add some new
> set_module_{init,core}_ro_nx() helper functions for more symmetry with
> the unset functions.
Yes, this seems sensible.
One nit to pick:
> + unsigned long total_size,
> + int (*set_ro)(unsigned long start, int num_pages),
> + int (*set_nx)(unsigned long start, int num_pages))
...
> + set_section_ro_nx(mod->module_core, mod->core_text_size,
> + mod->core_ro_size, mod->core_size,
> + set_memory_rw, set_memory_x);
set_ro == set_memory_rw here. That's just confusing.
I think we have to avoid the word "set" in the function parameters
since it may unset instead.
Suggest "alter_ro" or "frob_ro" instead?
Thanks,
Rusty.
next prev parent reply other threads:[~2015-11-08 22:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-05 21:18 [PATCH v2 0/3] CONFIG_DEBUG_SET_MODULE_RONX bug fix and cleanups Josh Poimboeuf
2015-11-05 21:18 ` [PATCH v2 1/3] livepatch: Fix crash with !CONFIG_DEBUG_SET_MODULE_RONX Josh Poimboeuf
2015-11-06 10:14 ` Jiri Kosina
2015-11-05 21:18 ` [PATCH v2 2/3] module: Use the same logic for setting and unsetting RO/NX Josh Poimboeuf
2015-11-08 19:40 ` Rusty Russell [this message]
2015-11-05 21:18 ` [PATCH v2 3/3] livepatch: Cleanup module page permission changes Josh Poimboeuf
2015-11-06 10:40 ` Petr Mladek
2015-11-06 12:12 ` Josh Poimboeuf
2015-11-06 13:42 ` Petr Mladek
2015-11-06 17:14 ` Josh Poimboeuf
2015-11-08 23:01 ` Rusty Russell
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=87d1vk2saq.fsf@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=cbay@alwaysdata.com \
--cc=jikos@kernel.org \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=live-patching@vger.kernel.org \
--cc=mbenes@suse.cz \
--cc=sjenning@redhat.com \
--cc=vojtech@suse.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