From patchwork Thu Dec 14 12:49:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitri John Ledkov X-Patchwork-Id: 1876172 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SrXJ31f4gz23nF for ; Thu, 14 Dec 2023 23:50:10 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1rDlA3-0003Mn-0s; Thu, 14 Dec 2023 12:49:55 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1rDl9z-0003LP-21 for kernel-team@lists.ubuntu.com; Thu, 14 Dec 2023 12:49:51 +0000 Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id B76E63F18B for ; Thu, 14 Dec 2023 12:49:50 +0000 (UTC) Received: by mail-lj1-f198.google.com with SMTP id 38308e7fff4ca-2c9ef4b6ce4so66682921fa.1 for ; Thu, 14 Dec 2023 04:49:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702558190; x=1703162990; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Y3h2JD/5korM0cOMwmuNhwueZGO5HQVJsOZTb25enjc=; b=GiFk5/cmkz2WrXukwwxBPgjUJegzge4N6ese/bp7hFli/+xvxHMX9bOqwlUv6qJtYJ wMepkKXQY/rPEl5iMVpvQVDzn1KtVKFI/JMGtbzBLgg3z3zM4nOtVY9wota9HPijGlsn wg8VSVV6+lXovY1ErN1pPk7qcnKNwjyTiMIDFFQ2tuNa1GYFbk9wBgHkdURzAP+iFDKx KuXmtxzQvlliCiE6FcNDyEf8MSKxaPUAp0W7djPu6FlkxPcPAoCuoruY1vMncBBVY4s3 zoKtCxMHkrPlmWSmhQxLGFrQpIMEL2U1SMFrYyodWvI+Hfzn4HNYcugB/WFvWDCb52wu g2qA== X-Gm-Message-State: AOJu0YzhQsoi5RdZuMTpoj4OTMqyqmOFAbJQ3qTko7t9KXWUZGGkrAV/ fUBGmRqoa8WC2yxIfJ3JC9qx9FkEWT8AhjgIXwMROkzJSFgI004KTab8FFFp6tKqQoAUlBxuetb 7WMzVakbsyJmbRzzh6oC8ta0/r5a93iiU3i90vLiqb9xTznqpvw== X-Received: by 2002:a2e:ab09:0:b0:2cc:208b:98c5 with SMTP id ce9-20020a2eab09000000b002cc208b98c5mr5695007ljb.44.1702558189799; Thu, 14 Dec 2023 04:49:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IF0WSy5YUQVFk8sSUNUEwLKvgjOJaW9eRrvftxihq2Lp8Kw3XiE2t/gaZ2qB0OH/L9N7YymqA== X-Received: by 2002:a2e:ab09:0:b0:2cc:208b:98c5 with SMTP id ce9-20020a2eab09000000b002cc208b98c5mr5694997ljb.44.1702558189435; Thu, 14 Dec 2023 04:49:49 -0800 (PST) Received: from localhost ([2001:67c:1560:8007::aac:c15c]) by smtp.gmail.com with ESMTPSA id j12-20020a5d452c000000b003363db0399asm4014040wra.94.2023.12.14.04.49.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 04:49:48 -0800 (PST) From: Dimitri John Ledkov To: kernel-team@lists.ubuntu.com Subject: [UNSTABLE][PATCH 2/5] UBUNTU: SAUCE: objtool: make objtool SLS validation fatal when building with CONFIG_SLS=y Date: Thu, 14 Dec 2023 12:49:37 +0000 Message-Id: <20231214124940.3281278-3-dimitri.ledkov@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231214124940.3281278-1-dimitri.ledkov@canonical.com> References: <20231214124940.3281278-1-dimitri.ledkov@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/2046440 Make objtool SLS validation fatal when building with CONFIG_SLS=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 Link: https://lore.kernel.org/all/20231213134303.2302285-3-dimitri.ledkov@canonical.com/ --- tools/objtool/check.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 15df4afae2..9709f037f1 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -4500,7 +4500,9 @@ static int validate_sls(struct objtool_file *file) } } - return warnings; + /* SLS is an optional security safety feature, make it fatal + * to ensure no new code is introduced that fails SLS */ + return -warnings; } static bool ignore_noreturn_call(struct instruction *insn)