Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp2129607rwe; Fri, 2 Sep 2022 08:57:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR4INyMWh4aMBooIrCpZQdQy34+HhwDCg5vGgsBflA525/28OF6L78sKGCaMPGtss9TMRDwb X-Received: by 2002:a17:907:1c89:b0:741:4453:75be with SMTP id nb9-20020a1709071c8900b00741445375bemr21941473ejc.208.1662134246052; Fri, 02 Sep 2022 08:57:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662134246; cv=none; d=google.com; s=arc-20160816; b=jnQmD8XjMLUbRqx/M4rzJoMQfiKKcWpkFfZICIYAFJq5zBvOhn0gO+FG9zZYvKs69V gENOBxpvuqaMpyeOd3l+wVeplIWnF9xQxSOZDwBXCCKP8TUtzk9pt1MOpQ1/IvQkmgDD JXtSlqQQ0qdZtiO8H2Lahqx9HMlOpONClPGvDpCQz8uxgLPhytJzvnQjRnquumMzXbAr E1hdlIojBx5d1ZjMfLFj23ry9kJ7e4ravZgP6fxv+rBA6NutlasNC2W5Y1jSKKsC+JEO WHbdPfZ3KXNnjZGEOi5mI2wQrxghqnzQ73mgJDY6oYZOnJKr2jhR/TsfbbnXF3LZ/HAI ve2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=qHqsAPPCyGA4WeBXFYKA1c6V37939d+QNoD3+LN6qbM=; b=xv3MnM0kSLYlBBfgRHfFlvXnHPowguzLCtyw2ApAlcu/R7y8QEisXEDZAweaVz3gP0 4wBz6W6U4qgLbq1UYT31P3ZFYTt0eLSuxjh/PaVZ+ShAa1VD1shUntL27stkE+T9cqfX 08tZ4EdSUsywrf8NKRshck2rd7uSQMxjxSMW6IEps+yT1dCDoy+tYyro8HyuA9/omcQm /zaE6rwTSMz9TOy3mxu12lGmbJDNNOGLz83EuMXy48uBIIndl1j8IdHiGOn5m5L0a3u7 HTjX6ZH/Nq0zYi1F6U5ifDOkTqo0HtH3qBQS0JBUaUQdVkz6ajpwSJfFYAjFKL6nO2yR gc1Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nb1-20020a1709071c8100b00730d36cd631si731572ejc.816.2022.09.02.08.56.37; Fri, 02 Sep 2022 08:57:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236881AbiIBPjP (ORCPT + 99 others); Fri, 2 Sep 2022 11:39:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236649AbiIBPi1 (ORCPT ); Fri, 2 Sep 2022 11:38:27 -0400 Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68307D5735 for ; Fri, 2 Sep 2022 08:25:44 -0700 (PDT) Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4MK1vW3Wfkz9sZ3; Fri, 2 Sep 2022 17:25:43 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QPSFDO7JHai2; Fri, 2 Sep 2022 17:25:43 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4MK1vV4t3qz9sff; Fri, 2 Sep 2022 17:25:42 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 973788B764; Fri, 2 Sep 2022 17:25:42 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id CYFeafEYm9IA; Fri, 2 Sep 2022 17:25:42 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (unknown [192.168.232.39]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 581E18B787; Fri, 2 Sep 2022 17:25:42 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (localhost [127.0.0.1]) by PO20335.IDSI0.si.c-s.fr (8.17.1/8.16.1) with ESMTPS id 282FPVCa2217410 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 2 Sep 2022 17:25:31 +0200 Received: (from chleroy@localhost) by PO20335.IDSI0.si.c-s.fr (8.17.1/8.17.1/Submit) id 282FPUMj2217380; Fri, 2 Sep 2022 17:25:30 +0200 X-Authentication-Warning: PO20335.IDSI0.si.c-s.fr: chleroy set sender to christophe.leroy@csgroup.eu using -f From: Christophe Leroy To: Michael Ellerman , Nicholas Piggin Cc: Christophe Leroy , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH v2] powerpc/vdso: link with -z noexecstack Date: Fri, 2 Sep 2022 17:25:24 +0200 Message-Id: X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1662132323; l=2291; s=20211009; h=from:subject:message-id; bh=1t0lJDIli6rqkKhPYM/6mAJjgb0mjc9+/i/6Gd5VKd4=; b=GS9dzfO8nvY0H/dFq+PXD7w8mxK6h81gVlUTrwOkNQtOAmuTzoPuZla9o5Z7AIKE+npi198uUc7q tNdr7NTyBPEydSBjB50jA0IJ4WUqgtPn/usPib8+va3qsykMgV09 X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org With recent binutils, the following warning appears: VDSO32L arch/powerpc/kernel/vdso/vdso32.so.dbg /opt/gcc-12.2.0-nolibc/powerpc64-linux/bin/../lib/gcc/powerpc64-linux/12.2.0/../../../../powerpc64-linux/bin/ld: warning: arch/powerpc/kernel/vdso/getcpu-32.o: missing .note.GNU-stack section implies executable stack /opt/gcc-12.2.0-nolibc/powerpc64-linux/bin/../lib/gcc/powerpc64-linux/12.2.0/../../../../powerpc64-linux/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker To avoid that, explicitely tell the linker we don't want executable stack. For more explanations, see commit ffcf9c5700e4 ("x86: link vdso and boot with -z noexecstack --no-warn-rwx-segments") Signed-off-by: Christophe Leroy --- v2: Removed unrelated change in arch/powerpc/kernel/Makefile --- arch/powerpc/kernel/vdso/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/vdso/Makefile b/arch/powerpc/kernel/vdso/Makefile index 096b0bf1335f..a2e7b0ce5b19 100644 --- a/arch/powerpc/kernel/vdso/Makefile +++ b/arch/powerpc/kernel/vdso/Makefile @@ -92,13 +92,13 @@ include/generated/vdso64-offsets.h: $(obj)/vdso64.so.dbg FORCE # actual build commands quiet_cmd_vdso32ld_and_check = VDSO32L $@ - cmd_vdso32ld_and_check = $(VDSOCC) $(c_flags) $(CC32FLAGS) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^) ; $(cmd_vdso_check) + cmd_vdso32ld_and_check = $(VDSOCC) $(c_flags) $(CC32FLAGS) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^) -z noexecstack ; $(cmd_vdso_check) quiet_cmd_vdso32as = VDSO32A $@ cmd_vdso32as = $(VDSOCC) $(a_flags) $(CC32FLAGS) $(AS32FLAGS) -c -o $@ $< quiet_cmd_vdso32cc = VDSO32C $@ cmd_vdso32cc = $(VDSOCC) $(c_flags) $(CC32FLAGS) -c -o $@ $< quiet_cmd_vdso64ld_and_check = VDSO64L $@ - cmd_vdso64ld_and_check = $(VDSOCC) $(c_flags) $(CC64FLAGS) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^) ; $(cmd_vdso_check) + cmd_vdso64ld_and_check = $(VDSOCC) $(c_flags) $(CC64FLAGS) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^) -z noexecstack ; $(cmd_vdso_check) quiet_cmd_vdso64as = VDSO64A $@ cmd_vdso64as = $(VDSOCC) $(a_flags) $(CC64FLAGS) $(AS64FLAGS) -c -o $@ $< -- 2.37.1