Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753481AbbDMJDE (ORCPT ); Mon, 13 Apr 2015 05:03:04 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:26476 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753310AbbDMJDB (ORCPT ); Mon, 13 Apr 2015 05:03:01 -0400 Date: Mon, 13 Apr 2015 11:04:55 +0200 From: Quentin Casasnovas To: Rusty Russell Cc: Quentin Casasnovas , lkml , Oleg Nesterov , Borislav Petkov , Linus Torvalds Subject: Re: [PATCH 1/7] modpost: add strict white-listing when referencing sections. Message-ID: <20150413090455.GA10845@chrystal.uk.oracle.com> References: <1426596002-26128-1-git-send-email-quentin.casasnovas@oracle.com> <1426596002-26128-2-git-send-email-quentin.casasnovas@oracle.com> <87sid0jw1m.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="NzB8fVQJ5HfG6fxh" Content-Disposition: inline In-Reply-To: <87sid0jw1m.fsf@rustcorp.com.au> User-Agent: Mutt/1.5.22 (2013-10-16) X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3476 Lines: 111 --NzB8fVQJ5HfG6fxh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Mar 20, 2015 at 11:59:41AM +1030, Rusty Russell wrote: > Quentin Casasnovas 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 > Thanks again! May I aks who's supposed to take the series? Or maybe it needs more acking? Quentin --NzB8fVQJ5HfG6fxh Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-modpost-document-the-use-of-struct-section_check.patch" >From acab15181879a18140ca3afa69776292e830ea72 Mon Sep 17 00:00:00 2001 From: Quentin Casasnovas 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 --- 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 --NzB8fVQJ5HfG6fxh-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/