mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
To: jpoimboe@kernel.org, peterz@infradead.org
Cc: x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 3/3] objtool: make objtool RETPOLINE validation fatal when building with CONFIG_RETPOLINE=y
Date: Wed, 13 Dec 2023 13:43:02 +0000	[thread overview]
Message-ID: <20231213134303.2302285-4-dimitri.ledkov@canonical.com> (raw)
In-Reply-To: <20231213134303.2302285-1-dimitri.ledkov@canonical.com>

Make objtool RETPOLINE validation fatal when building with
CONFIG_RETPOLINE=y, currently it is a build.log warning only.

This is a standalone patch, such that if regressions are identified
(with any config or toolchain configuration) it can be reverted until
relevant identified code is fixed up or otherwise
ignored/silecned/marked as safe.

Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
---
 tools/objtool/check.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 9709f037f1..c21258e109 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -3991,7 +3991,10 @@ static int validate_retpoline(struct objtool_file *file)
 		warnings++;
 	}
 
-	return warnings;
+	/* RETPOLINE is an optional security safety feature, make it
+	 * fatal to ensure no new code is introduced that fails
+	 * RETPOLINE */
+	return -warnings;
 }
 
 static bool is_kasan_insn(struct instruction *insn)
-- 
2.34.1


      parent reply	other threads:[~2023-12-13 13:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20231213134303.2302285-1-dimitri.ledkov@canonical.com>
2023-12-13 13:43 ` [PATCH v2 1/3] objtool: Make objtool check actually fatal upon fatal errors Dimitri John Ledkov
2024-01-08  9:15   ` Ingo Molnar
2024-01-09 19:24     ` Josh Poimboeuf
2024-01-09 19:48       ` Dimitri John Ledkov
2024-01-09 20:20         ` Josh Poimboeuf
2023-12-13 13:43 ` [PATCH v2 2/3] objtool: make objtool SLS validation fatal when building with CONFIG_SLS=y Dimitri John Ledkov
2024-01-08  9:16   ` Ingo Molnar
2024-01-09 19:31   ` Josh Poimboeuf
2023-12-13 13:43 ` Dimitri John Ledkov [this message]

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=20231213134303.2302285-4-dimitri.ledkov@canonical.com \
    --to=dimitri.ledkov@canonical.com \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=x86@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

all inboxes | Powered by JetHome®