[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAGXu5jLqdRWEyyd8-3f8_jpO3NG_y9oTxmxf67BfGxsh0iGedg@mail.gmail.com>
Date: Tue, 20 Dec 2016 09:02:07 -0800
From: Kees Cook <keescook@...omium.org>
To: Ingo Molnar <mingo@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, "x86@...nel.org" <x86@...nel.org>
Subject: Re: [PATCH v2] x86/floppy: use designated initializers
On Sun, Dec 18, 2016 at 12:00 AM, Ingo Molnar <mingo@...nel.org> wrote:
>
> * Kees Cook <keescook@...omium.org> wrote:
>
>> Prepare to mark sensitive kernel structures for randomization by making
>> sure they're using designated initializers. These were identified during
>> allyesconfig builds of x86, arm, and arm64, with most initializer fixes
>> extracted from grsecurity.
>>
>> Signed-off-by: Kees Cook <keescook@...omium.org>
>> ---
>> v2:
>> - aligned rhs of initializer, ingo
>> ---
>> arch/x86/include/asm/floppy.h | 20 ++++++++++----------
>> 1 file changed, 10 insertions(+), 10 deletions(-)
>>
>> diff --git a/arch/x86/include/asm/floppy.h b/arch/x86/include/asm/floppy.h
>> index 1c7eefe32502..202fe3e1fae8 100644
>> --- a/arch/x86/include/asm/floppy.h
>> +++ b/arch/x86/include/asm/floppy.h
>> @@ -229,18 +229,18 @@ static struct fd_routine_l {
>> int (*_dma_setup)(char *addr, unsigned long size, int mode, int io);
>> } fd_routine[] = {
>> {
>> - request_dma,
>> - free_dma,
>> - get_dma_residue,
>> - dma_mem_alloc,
>> - hard_dma_setup
>> + ._request_dma = request_dma,
>> + ._free_dma = free_dma,
>> + ._get_dma_residue = get_dma_residue,
>> + ._dma_mem_alloc = dma_mem_alloc,
>> + ._dma_setup = hard_dma_setup
>> },
>> {
>> - vdma_request_dma,
>> - vdma_nop,
>> - vdma_get_dma_residue,
>> - vdma_mem_alloc,
>> - vdma_dma_setup
>> + ._request_dma = vdma_request_dma,
>> + ._free_dma = vdma_nop,
>> + ._get_dma_residue = vdma_get_dma_residue,
>> + ._dma_mem_alloc = vdma_mem_alloc,
>> + ._dma_setup = vdma_dma_setup
>
> That's not how we organize named initializers, we do:
>
> ._request_dma = vdma_request_dma,
> ._free_dma = vdma_nop,
> ._get_dma_residue = vdma_get_dma_residue,
> ._dma_mem_alloc = vdma_mem_alloc,
> ._dma_setup = vdma_dma_setup
>
> I have fixed up the patch.
Ah-ha, thanks! When I did this patch, I first went looking through the
source but there didn't seem to be a consensus on where to put the
"=". :P Thanks for fixing it up!
-Kees
--
Kees Cook
Nexus Security
Powered by blists - more mailing lists