From patchwork Tue Feb 14 20:09:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 1742575 X-Patchwork-Delegate: trini@ti.com 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.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.a=rsa-sha256 header.s=google header.b=mQb6Rhhr; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PGXP21J7Yz23hX for ; Wed, 15 Feb 2023 07:09:42 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9AB4D8594C; Tue, 14 Feb 2023 21:09:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="mQb6Rhhr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5C05480A08; Tue, 14 Feb 2023 21:09:37 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qv1-xf2e.google.com (mail-qv1-xf2e.google.com [IPv6:2607:f8b0:4864:20::f2e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D2CC28594C for ; Tue, 14 Feb 2023 21:09:34 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qv1-xf2e.google.com with SMTP id t8so1575010qvr.5 for ; Tue, 14 Feb 2023 12:09:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=jMtKHjHEUQHZTCezFs2+bs32DnKmdI7dUQzCIehdKig=; b=mQb6RhhrY7GYBK2AuOuuvQy8ZQFRajOJ/d1h+lmAKOwt1KIm0azlBJXtHVrrFNITuG NLbJ2eWghkcjGdIRFC3blzUdL5VSqQr2RqGnGWIj+v4Tq10Eo275fQVpZszjZGnNFQkU D12Kn+R48CaYwNyMceN5GjENAQsG0aTilqz5I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jMtKHjHEUQHZTCezFs2+bs32DnKmdI7dUQzCIehdKig=; b=7UqvTBwKeAm51OzOiXmuzkQRjafzXYslgdd6vsKMJhPiuN/QWzS5rTXlGcnE7WJCMo R4+cwxluX6iVD+o49BwGpyWmipWk+1EEIHS3EBl0oa6O2CBy+VmtlID2MqIvm4yGhGkl kS7CgdSYaQ3YZkHj+6Sl4KqpxI7nljkEcjUxZsMtQb1SzXvplHWAHGC6ilWKsLong46K 286OpgRkwSczQxrNB3AG8gF4JD1h4zPsY3LMIHPePSomz6SD9WTlvdKQaXCBF6AX5Pxc OZ33VwIAaoovtJeQxEsMg3Rxx4Gdt3cSgCoikfmxEW6UVQuHCpqQgnf3nL/QfFF3a9yv NO/w== X-Gm-Message-State: AO0yUKUBoYlq7lMsJJo3vyqfft+uAbO45VCzAH3ya4TxY/mxAStRG7uc KH+0qctCCZN/IOcQECOMdqLsEUUTw+KhtvLRyCg= X-Google-Smtp-Source: AK7set+REazVRkblWy3BeJlLwJWbtud3uPohGeMgcc9Niq3mDT979iJ36qFp7Lxybxl0ARRcUEqYtg== X-Received: by 2002:a05:6214:252d:b0:56e:a07b:f4d0 with SMTP id gg13-20020a056214252d00b0056ea07bf4d0mr7626463qvb.23.1676405373414; Tue, 14 Feb 2023 12:09:33 -0800 (PST) Received: from bill-the-cat.lan (2603-6081-7b00-6400-c7c0-e2dd-6c89-7c7c.res6.spectrum.com. [2603:6081:7b00:6400:c7c0:e2dd:6c89:7c7c]) by smtp.gmail.com with ESMTPSA id u186-20020ae9d8c3000000b00731fe65bef2sm12342687qkf.66.2023.02.14.12.09.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 12:09:33 -0800 (PST) From: Tom Rini To: u-boot@lists.denx.de Subject: [PATCH 1/2] Makefile: Link with -z noexectack Date: Tue, 14 Feb 2023 15:09:31 -0500 Message-Id: <20230214200932.2354650-1-trini@konsulko.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean When moving to gcc-12.2 we started trying to quiet some of the new linker warnings, that are not relevant to us. However, a misunderstanding of the mechanics at play meant that I intentionally omitted passing -z noexecstack to the linker, when we do need to. Add this flag and in turn remove warnings from the linker. Fixes: 1e1c51f8ace8 ("Makefile: link with --no-warn-rwx-segments") Signed-off-by: Tom Rini Reviewed-by: Simon Glass --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 54f894dab841..bc1ee94fb74e 100644 --- a/Makefile +++ b/Makefile @@ -806,6 +806,7 @@ KBUILD_CPPFLAGS += $(KCPPFLAGS) KBUILD_AFLAGS += $(KAFLAGS) KBUILD_CFLAGS += $(KCFLAGS) +KBUILD_LDFLAGS += -z noexecstack KBUILD_LDFLAGS += $(call ld-option,--no-warn-rwx-segments) KBUILD_HOSTCFLAGS += $(if $(CONFIG_TOOLS_DEBUG),-g) From patchwork Tue Feb 14 20:09:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 1742576 X-Patchwork-Delegate: trini@ti.com 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.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.a=rsa-sha256 header.s=google header.b=EnjSqhTO; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PGXPB4sCsz23hX for ; Wed, 15 Feb 2023 07:09:50 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2FFF085958; Tue, 14 Feb 2023 21:09:43 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="EnjSqhTO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E367080A08; Tue, 14 Feb 2023 21:09:38 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6D0B985956 for ; Tue, 14 Feb 2023 21:09:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x833.google.com with SMTP id g8so18947427qtq.13 for ; Tue, 14 Feb 2023 12:09:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8BsJg2gI0wov/HXJmq/JVKXp3kg1e2aTNn488fGgiaw=; b=EnjSqhTO5rbrBG7+9H3G+cWSUF9za0igtxCu4aE/N9a5BzjiiAXUaC8fAR1RIAazCb u3IhzidZVeR0UID1/Sz9zGHs1Sw9cQJwtnzonQ8kZgoZcDd088gP23gkzmnC/fOd5Uoo UnPbmVHjyuvxp80GIV8yu0Qw1NR4vYivS5Mwc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8BsJg2gI0wov/HXJmq/JVKXp3kg1e2aTNn488fGgiaw=; b=t7IVwrXZ5nh0yeOHeu4Xj3FpvULcH+SQRuslh6Ai5qVDUacH51FgoyhKgsJme5+S4W GjWHLJARGLKDWxV2cfvkbJXaAHkj2uVmbu30tLZOcgZm+JBEo/Ks7lvedZJPAcVeu4Fj y2L9sFhYXpP1tzgZkO2xRmFEl6SYxXzdcOD+R4i9t5jewWOID799L0GTmoGneYBuozkV MrwvH6mHCPU9s5tiyH2DKWdEqBCfb2ghckiESI9WspXblHygvF9/mFJLzBIMNqEdFb9w rjAVedSWIVlaVLPLzB2ZnAXZ7fA1mYkPt6Eq+4eWxXrK+4Gk3lGWUhPXIUriZ0kJ5+Im hmxg== X-Gm-Message-State: AO0yUKVGcy1m8MYafz8go8ZMCNHVnFmZQi/9G0usUrzzjytW1ne5E3a9 B7bg36b0KHEe4F+B/svGmOdB6sMCdIuTqwi8VLM= X-Google-Smtp-Source: AK7set/vQQYl/VGBUAYvsXztQoP73fyeMirwAPcOCWk0GPUgcIx9FUqG/+krCPDsFZW1nTtBi5RzCA== X-Received: by 2002:ac8:4e83:0:b0:3b6:2f3d:70bc with SMTP id 3-20020ac84e83000000b003b62f3d70bcmr5540148qtp.53.1676405374081; Tue, 14 Feb 2023 12:09:34 -0800 (PST) Received: from bill-the-cat.lan (2603-6081-7b00-6400-c7c0-e2dd-6c89-7c7c.res6.spectrum.com. [2603:6081:7b00:6400:c7c0:e2dd:6c89:7c7c]) by smtp.gmail.com with ESMTPSA id u186-20020ae9d8c3000000b00731fe65bef2sm12342687qkf.66.2023.02.14.12.09.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 12:09:33 -0800 (PST) From: Tom Rini To: u-boot@lists.denx.de Cc: Bin Meng , Heinrich Schuchardt Subject: [PATCH 2/2] x86: Pass -z execstack for EFI payload flags Date: Tue, 14 Feb 2023 15:09:32 -0500 Message-Id: <20230214200932.2354650-2-trini@konsulko.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230214200932.2354650-1-trini@konsulko.com> References: <20230214200932.2354650-1-trini@konsulko.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean To match how we link EFI executables elsewhere, and to silence a linker warning, pass -z execstack here as well. Cc: Bin Meng Cc: Heinrich Schuchardt Signed-off-by: Tom Rini --- arch/x86/config.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/config.mk b/arch/x86/config.mk index a4a694ddf313..26ec1af2f0b0 100644 --- a/arch/x86/config.mk +++ b/arch/x86/config.mk @@ -37,7 +37,8 @@ KBUILD_LDFLAGS += -m $(if $(IS_32BIT),elf_i386,elf_x86_64) # This is used in the top-level Makefile which does not include # KBUILD_LDFLAGS -LDFLAGS_EFI_PAYLOAD := -Bsymbolic -Bsymbolic-functions -shared --no-undefined -s +LDFLAGS_EFI_PAYLOAD := -Bsymbolic -Bsymbolic-functions -shared --no-undefined \ + -s -zexecstack OBJCOPYFLAGS_EFI := -j .text -j .sdata -j .data -j .dynamic -j .dynsym \ -j .rel -j .rela -j .reloc --strip-all