[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABCJKueALv=zBf3MYwN-EaeGxN3py-tReb3sVaqe9caCt8cJwA@mail.gmail.com>
Date: Fri, 13 Nov 2020 10:59:51 -0800
From: Sami Tolvanen <samitolvanen@...gle.com>
To: Randy Dunlap <rdunlap@...radead.org>
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 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.
Sami
Powered by blists - more mailing lists