[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <352fcf22-aa5d-8f4b-686e-44df25f3ff4a@infradead.org>
Date: Fri, 13 Nov 2020 11:01:32 -0800
From: Randy Dunlap <rdunlap@...radead.org>
To: Sami Tolvanen <samitolvanen@...gle.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Kees Cook <keescook@...omium.org>, X86 ML <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Sedat Dilek <sedat.dilek@...il.com>
Subject: Re: [PATCH] x86/e820: fix the function type for e820__mapped_all
On 11/13/20 10:59 AM, Sami Tolvanen wrote:
> On Fri, Nov 13, 2020 at 10:35 AM Randy Dunlap <rdunlap@...radead.org> wrote:
>>
>> On 11/13/20 10:26 AM, Sami Tolvanen wrote:
>>> e820__mapped_all is passed as a callback to is_mmconf_reserved, which
>>> expects a function of type:
>>>
>>> typedef bool (*check_reserved_t)(u64 start, u64 end, unsigned type);
>>>
>>> This trips indirect call checking with Clang's Control-Flow Integrity
>>> (CFI). Change the last argument from enum e820_type to unsigned to fix
>>> the type mismatch.
>>
>> Hi,
>>
>> Kernel style is no raw unsigned -- use unsigned int or unsigned long, please.
>>
>> checkpatch should or could have found that issue.
>
> It did, but the existing type definition for the callback in
> pci/mmconfig-shared.c uses raw unsigned. I can add a patch to change
> that to unsigned int as well, if you prefer.
Hm. :)
Well, yes, I prefer, but I can't require it.
thanks for the explanation.
--
~Randy
Powered by blists - more mailing lists