All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Joerg Roedel <jroedel@suse.de>, Borislav Petkov <bp@alien8.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Toshimitsu Kani <toshi.kani@hpe.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Kees Cook <keescook@chromium.org>, Ingo Molnar <mingo@kernel.org>,
	Andy Lutomirski <luto@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: linux-tip-commits@vger.kernel.org
Subject: Re: [tip:x86/urgent] x86/mm: Avoid VLA in pgd_alloc()
Date: Tue, 9 Oct 2018 09:58:24 +0200	[thread overview]
Message-ID: <CAK8P3a2Ve91DbOtrjLmWifZMb-icwVa-J-XJ=W5am4-thWrmBw@mail.gmail.com> (raw)
In-Reply-To: <tip-184d47f0fd365108bd06ab26cdb3450b716269fd@git.kernel.org>

On Tue, Oct 9, 2018 at 9:03 AM tip-bot for Kees Cook <tipbot@zytor.com> wrote:
>
> Commit-ID:  184d47f0fd365108bd06ab26cdb3450b716269fd
> Gitweb:     https://git.kernel.org/tip/184d47f0fd365108bd06ab26cdb3450b716269fd
> Author:     Kees Cook <keescook@chromium.org>
> AuthorDate: Mon, 8 Oct 2018 16:54:34 -0700
> Committer:  Ingo Molnar <mingo@kernel.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@arndb.de>
> Original-written-by: Arnd Bergmann <arnd@arndb.de>
> Reported-by: Borislav Petkov <bp@alien8.de>
> Signed-off-by: Kees Cook <keescook@chromium.org>

Thanks for fixing up my incorrect fix, looks correct to me now.

       Arnd

  reply	other threads:[~2018-10-09  7:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-08 23:54 [PATCH] x86/mm: Fix preallocated PMD stack array Kees Cook
2018-10-09  7:03 ` [tip:x86/urgent] x86/mm: Avoid VLA in pgd_alloc() tip-bot for Kees Cook
2018-10-09  7:58   ` Arnd Bergmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-10-05 16:13 [PATCH] x86: avoid " Arnd Bergmann
2018-10-05 16:24 ` [tip:x86/urgent] x86/mm: Avoid " tip-bot for Arnd Bergmann
2018-10-08 20:22   ` Borislav Petkov
2018-10-08 23:28     ` Kees Cook
2018-10-09  7:33       ` Arnd Bergmann
2018-10-09  7:39         ` Joerg Roedel
2018-10-09  7:48           ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAK8P3a2Ve91DbOtrjLmWifZMb-icwVa-J-XJ=W5am4-thWrmBw@mail.gmail.com' \
    --to=arnd@arndb.de \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jroedel@suse.de \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=toshi.kani@hpe.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.