From: Rusty Russell <rusty@ozlabs.org>
To: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Cc: Quentin Casasnovas <quentin.casasnovas@oracle.com>,
lkml <linux-kernel@vger.kernel.org>,
Oleg Nesterov <oleg@redhat.com>, Borislav Petkov <bp@alien8.de>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH 1/7] modpost: add strict white-listing when referencing sections.
Date: Mon, 13 Apr 2015 20:49:00 +0930 [thread overview]
Message-ID: <87pp78tgwr.fsf@rustcorp.com.au> (raw)
In-Reply-To: <20150413090455.GA10845@chrystal.uk.oracle.com>
Quentin Casasnovas <quentin.casasnovas@oracle.com> writes:
> On Fri, Mar 20, 2015 at 11:59:41AM +1030, Rusty Russell wrote:
>> Quentin Casasnovas <quentin.casasnovas@oracle.com> writes:
>> > Prints a warning when a section references a section outside a strict
>> > white-list. This will be useful to print a warning if __ex_table
>> > references a non-executable section.
>>
>> Hi Quentin,
>>
>> Really pleasant to read these patches; nice work!
>>
>
> Thanks! :)
>
>> > diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
>> > index d439856..7094a57 100644
>> > --- a/scripts/mod/modpost.c
>> > +++ b/scripts/mod/modpost.c
>> > @@ -925,7 +925,8 @@ enum mismatch {
>> >
>> > struct sectioncheck {
>> > const char *fromsec[20];
>> > - const char *tosec[20];
>> > + const char *bad_tosec[20];
>> > + const char *good_tosec[20];
>> > enum mismatch mismatch;
>> > const char *symbol_white_list[20];
>>
>> My only gripe is that these fields are undocumented. You maintain
>> the status quo, but some comments indicating what the mean would be
>> nice. Perhaps as a separate patch.
>>
>
> Derp, I was sure I had sent a patch following your comment.. Please find
> one attached to this e-mail. It should apply cleanly on top of this
> series.
>
>> In case you need it (for the whole series):
>> Acked-by: Rusty Russell <rusty@rustcorp.com.au>
>>
>
> Thanks again!
>
> May I aks who's supposed to take the series? Or maybe it needs more
> acking?
If noone else has taken it, I'll do so now.
Applied,
Rusty.
>
> Quentin
>>From acab15181879a18140ca3afa69776292e830ea72 Mon Sep 17 00:00:00 2001
> From: Quentin Casasnovas <quentin.casasnovas@oracle.com>
> Date: Mon, 13 Apr 2015 10:55:38 +0200
> Subject: [PATCH] modpost: document the use of struct section_check.
>
> struct section_check is used as a generic way of describing what
> relocations are authorized/forbidden when running modpost. This commit
> tries to describe how each field is used.
>
> Signed-off-by: Quentin Casasnovas <quentin.casasnovas@oracle.com>
> ---
> scripts/mod/modpost.c | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> index dfe9c3c..7b56ae5 100644
> --- a/scripts/mod/modpost.c
> +++ b/scripts/mod/modpost.c
> @@ -930,6 +930,26 @@ enum mismatch {
> EXTABLE_TO_NON_TEXT,
> };
>
> +/**
> + * Describe how to match sections on different criterias:
> + *
> + * @fromsec: Array of sections to be matched.
> + *
> + * @bad_tosec: Relocations applied to a section in @fromsec to a section in
> + * this array is forbidden (black-list). Can be empty.
> + *
> + * @good_tosec: Relocations applied to a section in @fromsec must be
> + * targetting sections in this array (white-list). Can be empty.
> + *
> + * @mistmatch: Type of mismatch.
> + *
> + * @symbol_white_list: Do not match a relocation to a symbol in this list
> + * even if it is targetting a section in @bad_to_sec.
> + *
> + * @handler: Specific handler to call when a match is found. If NULL,
> + * default_mismatch_handler() will be called.
> + *
> + */
> struct sectioncheck {
> const char *fromsec[20];
> const char *bad_tosec[20];
> --
> 2.0.5
next prev parent reply other threads:[~2015-04-13 11:31 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-17 12:39 [PATCH 0/7] Detect future mis-uses of __ex_table section Quentin Casasnovas
2015-03-17 12:39 ` [PATCH 1/7] modpost: add strict white-listing when referencing sections Quentin Casasnovas
2015-03-17 16:25 ` Linus Torvalds
2015-03-18 9:14 ` Quentin Casasnovas
2015-03-20 1:29 ` Rusty Russell
2015-04-13 9:04 ` Quentin Casasnovas
2015-04-13 11:19 ` Rusty Russell [this message]
2015-04-13 11:24 ` Rusty Russell
2015-03-17 12:39 ` [PATCH 2/7] modpost: add .sched.text and .kprobes.text to the TEXT_SECTIONS list Quentin Casasnovas
2015-03-18 9:08 ` Quentin Casasnovas
2015-03-17 12:39 ` [PATCH 3/7] modpost: add handler function pointer to sectioncheck Quentin Casasnovas
2015-03-18 9:08 ` Quentin Casasnovas
2015-03-17 12:39 ` [PATCH 4/7] modpost: factorize symbol pretty print in get_pretty_name() Quentin Casasnovas
2015-03-18 9:08 ` Quentin Casasnovas
2015-03-17 12:40 ` [PATCH 5/7] modpost: mismatch_handler: retrieve tosym information only when needed Quentin Casasnovas
2015-03-18 9:09 ` Quentin Casasnovas
2015-03-17 12:40 ` [PATCH 6/7] scripts: add check_extable.sh script Quentin Casasnovas
2015-03-18 9:09 ` Quentin Casasnovas
2015-03-17 12:40 ` [PATCH 7/7] modpost: handle relocations mismatch in __ex_table Quentin Casasnovas
2015-03-18 9:09 ` Quentin Casasnovas
2015-04-13 11:18 ` Rusty Russell
2015-04-13 13:33 ` Quentin Casasnovas
2015-04-14 12:14 ` Thierry Reding
2015-04-14 12:35 ` Quentin Casasnovas
2015-04-15 3:27 ` Rusty Russell
2015-04-15 8:35 ` Quentin Casasnovas
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=87pp78tgwr.fsf@rustcorp.com.au \
--to=rusty@ozlabs.org \
--cc=bp@alien8.de \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=quentin.casasnovas@oracle.com \
--cc=torvalds@linux-foundation.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 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).