[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK8P3a2Ve91DbOtrjLmWifZMb-icwVa-J-XJ=W5am4-thWrmBw@mail.gmail.com>
Date: Tue, 9 Oct 2018 09:58:24 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Joerg Roedel <jroedel@...e.de>, Borislav Petkov <bp@...en8.de>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Toshimitsu Kani <toshi.kani@....com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"H. Peter Anvin" <hpa@...or.com>,
Kees Cook <keescook@...omium.org>,
Ingo Molnar <mingo@...nel.org>,
Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>
Cc: linux-tip-commits@...r.kernel.org
Subject: Re: [tip:x86/urgent] x86/mm: Avoid VLA in pgd_alloc()
On Tue, Oct 9, 2018 at 9:03 AM tip-bot for Kees Cook <tipbot@...or.com> wrote:
>
> Commit-ID: 184d47f0fd365108bd06ab26cdb3450b716269fd
> Gitweb: https://git.kernel.org/tip/184d47f0fd365108bd06ab26cdb3450b716269fd
> Author: Kees Cook <keescook@...omium.org>
> AuthorDate: Mon, 8 Oct 2018 16:54:34 -0700
> Committer: Ingo Molnar <mingo@...nel.org>
> CommitDate: Tue, 9 Oct 2018 08:55:07 +0200
>
> x86/mm: Avoid VLA in pgd_alloc()
>
> Arnd Bergmann reported that turning on -Wvla found a new (unintended) VLA usage:
>
> arch/x86/mm/pgtable.c: In function 'pgd_alloc':
> include/linux/build_bug.h:29:45: error: ISO C90 forbids variable length array 'u_pmds' [-Werror=vla]
> arch/x86/mm/pgtable.c:190:34: note: in expansion of macro 'static_cpu_has'
> #define PREALLOCATED_USER_PMDS (static_cpu_has(X86_FEATURE_PTI) ? \
> ^~~~~~~~~~~~~~
> arch/x86/mm/pgtable.c:431:16: note: in expansion of macro 'PREALLOCATED_USER_PMDS'
> pmd_t *u_pmds[PREALLOCATED_USER_PMDS];
> ^~~~~~~~~~~~~~~~~~~~~~
>
> Use the actual size of the array that is used for X86_FEATURE_PTI,
> which is known at build time, instead of the variable size.
>
> [ mingo: Squashed original fix with followup fix to avoid bisection breakage, wrote new changelog. ]
>
> Reported-by: Arnd Bergmann <arnd@...db.de>
> Original-written-by: Arnd Bergmann <arnd@...db.de>
> Reported-by: Borislav Petkov <bp@...en8.de>
> Signed-off-by: Kees Cook <keescook@...omium.org>
Thanks for fixing up my incorrect fix, looks correct to me now.
Arnd
Powered by blists - more mailing lists