linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: glider@google.com
To: keescook@chromium.org, jannh@google.com, ard.biesheuvel@linaro.org
Cc: linux-kernel@vger.kernel.org, Alexander Potapenko <glider@google.com>
Subject: [PATCH] lib/test_stackinit: move a local outside the switch statement
Date: Tue, 18 Feb 2020 10:48:15 +0100	[thread overview]
Message-ID: <20200218094815.233387-1-glider@google.com> (raw)

Right now CONFIG_INIT_STACK_ALL is unable to initialize locals declared
in switch statements, see http://llvm.org/PR44916.
Move the variable declaration outside the switch in lib/test_stackinit.c
to prevent potential test failures until this is sorted out.

Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Alexander Potapenko <glider@google.com>
---
 lib/test_stackinit.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/test_stackinit.c b/lib/test_stackinit.c
index 2d7d257a430e..41e2a6e0cdaa 100644
--- a/lib/test_stackinit.c
+++ b/lib/test_stackinit.c
@@ -282,9 +282,9 @@ DEFINE_TEST(user, struct test_user, STRUCT, none);
  */
 static int noinline __leaf_switch_none(int path, bool fill)
 {
-	switch (path) {
-		uint64_t var;
+	uint64_t var;
 
+	switch (path) {
 	case 1:
 		target_start = &var;
 		target_size = sizeof(var);
-- 
2.25.0.265.gbab2e86ba0-goog


             reply	other threads:[~2020-02-18  9:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-18  9:48 glider [this message]
2020-02-19 17:36 ` [PATCH] lib/test_stackinit: move a local outside the switch statement Kees Cook
2020-02-19 17:56   ` Alexander Potapenko
2020-02-19 21:58     ` Kees Cook

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=20200218094815.233387-1-glider@google.com \
    --to=glider@google.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=jannh@google.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).