[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXu5jLk7tQDXWdvvYFeVoqmFwQp4yF6vv+AfTjJqXoaGFx8OA@mail.gmail.com>
Date: Thu, 29 Nov 2018 13:28:48 -0800
From: Kees Cook <keescook@...omium.org>
To: Dave Hansen <dave.hansen@...el.com>,
Yangtao Li <tiny.windzz@...il.com>,
Ingo Molnar <mingo@...hat.com>
Cc: Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>, X86 ML <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] x86/mm/dump_pagetables: Change to use DEFINE_SHOW_ATTRIBUTE
macro
On Wed, Nov 28, 2018 at 10:45 AM Dave Hansen <dave.hansen@...el.com> wrote:
>
> On 11/27/18 2:50 PM, Kees Cook wrote:
> > On Mon, Nov 19, 2018 at 9:06 AM, Dave Hansen <dave.hansen@...el.com> wrote:
> >> On 11/19/18 7:43 AM, Yangtao Li wrote:
> >>> -static const struct file_operations ptdump_curusr_fops = {
> >>> - .owner = THIS_MODULE,
> >>> - .open = ptdump_open_curusr,
> >>> - .read = seq_read,
> >>> - .llseek = seq_lseek,
> >>> - .release = single_release,
> >>> -};
> >>> +DEFINE_SHOW_ATTRIBUTE(ptdump_curusr);
> >>
> >> FWIW, I rather dislike this conversion and the DEFINE_SHOW_ATTRIBUTE()
> >> approach in general. It makes it basically impossible to go from
> >> ptdump_curusr to ptdump_open_curusr without opening up the macro and
> >> reverse-engineering it.
> >>
> >> My test is that for these macros to be sane, I need to be able to find
> >> "ptdump_open_curusr" by grepping for "ptdump_curusr". This fails the test.
> >
> > Er, "ptdump_curusr" matches the generated name "ptdump_curusr_show",
> > is that what you mean?
>
> Ahh, I also missed some of the renames to make this OK, like:
>
> > -static int ptdump_show_efi(struct seq_file *m, void *v)
> > +static int ptdump_efi_show(struct seq_file *m, void *v)
>
> I thought there was some macro magic going on that screwed the names up.
>
> This looks fine to me.
>
> Reviewed-by: Dave Hansen <dave.hansen@...ux.intel.com>
Cool, thanks!
Reviewed-by: Kees Cook <keescook@...omium.org>
Ingo, can you toss this in -tip please?
--
Kees Cook
Powered by blists - more mailing lists