Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6016937rwd; Wed, 24 May 2023 09:40:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5D/09f5Dalg4Fee31TIk2d81ohB/n4Oy0nGRLZ0rJF74jFegSp/KUxFaiTM+IOvVwBiZqA X-Received: by 2002:a17:90a:2b49:b0:255:70e4:ad25 with SMTP id y9-20020a17090a2b4900b0025570e4ad25mr10459789pjc.15.1684946424158; Wed, 24 May 2023 09:40:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684946424; cv=none; d=google.com; s=arc-20160816; b=UCztr6TgisU7dEqwl21DJJFQLCZTIeP4VnONfauQOiD9icLV2jgDVtaIbqraryWCL7 vKuvWEo3YMmllX6FeUbT31DLBsP674pCaAjfZ2DzjN/PPCxk0FZC9xMKwOkVISINJxI6 df63lAGvanzOJW5YegJJv0YRJat8+QBs2oinG0WXCmU9gTqtIZ4mxx62YelOnehH7D/2 yw0gxyY/biMjDQXvx7BM4jd2CmWJwt9kRyKqeavLrX7agau4TzPs8J13sCGOXHr0LCtW ZSMVE7N+a6JEgbAIHaq7kODYEZKomLl7kjh6qr06gT0KcQz8Qs/S3Xbh+8C5XzMXYmP/ SITg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:dkim-signature:from; bh=CsuMfY20KUZYX8wSzrWS2txd3qDM8MNEneUhQ3VenDU=; b=gdvDg2R5x1M33HmMKcVbR67hnK1cr+ToWuPZShRwP8iCHQSi3ePue9hauFxzJ2vkxd Aab9tYGQhaRuf47SLkvz/IMq8gKkjI4raHOdYKpMxhoDnS+0nhf6vgeh+duSfhFuQOr0 ZzeJzNvw1OyJ05HwfPE0t3FkvJ3UYBfZdvTsUBD/2CBUY837Lx4EDKpiWuTCHz/u+IvR 1IAgIQO23/M0t2cbBEQwKHWH6VDwI40zsmVUsxasMiEqOL65i8+8fCYkhcaL18tPruQy G8tahRV5NRI2W7sCCYqqiEYd92qYy21s5028GG0bkloqcaET2jjfB7MBfRH2q/nwvT24 yQSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=Yie6dcFb; 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 k70-20020a638449000000b00536b4c4b695si3781014pgd.136.2023.05.24.09.40.10; Wed, 24 May 2023 09:40:24 -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; dkim=pass header.i=@weissschuh.net header.s=mail header.b=Yie6dcFb; 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 S232201AbjEXQ1P (ORCPT + 99 others); Wed, 24 May 2023 12:27:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231494AbjEXQ1P (ORCPT ); Wed, 24 May 2023 12:27:15 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC30FD3 for ; Wed, 24 May 2023 09:27:13 -0700 (PDT) From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1684945631; bh=+yjURdh4Gw0iv1zcKNP9yQwERjDy1N0llqhBN14GwCE=; h=From:Date:Subject:To:Cc:From; b=Yie6dcFb92zaoqR5XDD15VqsLdK+8pEe7mvg4HqAGcxB1BKqaRzh9pV0FxGhd1lHn qosPbKhnDAjE9+XQf5m90Xq8b/zXztc19zxbeqlDOyzLnjgtK2N5xTtTYVhkDl11wK bCNPkwbjKqInt0NmmbIodNe5pkvzdLQWTW5M5ITI= Date: Wed, 24 May 2023 18:27:06 +0200 Subject: [PATCH] tools/nolibc: s390: disable stackprotector in _start MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20230524-nolibc-stackprotector-s390-v1-1-5044d42230cc@weissschuh.net> X-B4-Tracking: v=1; b=H4sIANk6bmQC/x2NQQrCMBAAv1L27ELaWqV+RXpI1o1dDEnZjSKU/ t3gceYws4OxChvcuh2UP2JScoP+1AGtPj8Z5dEYBjeMbhrOmEuSQGjV02vTUplqUbRxdugCTdT P1xgvEVogeGMM6jOtLZHfKTW5KUf5/o/35Th+XSJ/1YEAAAA= To: Willy Tarreau Cc: linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1684945631; l=1601; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=+yjURdh4Gw0iv1zcKNP9yQwERjDy1N0llqhBN14GwCE=; b=dXurvyihFtDs0PtghqpB8PY+aMcTnNDj5C1pt/iKH7qecQaqDHFm+TC2ACbpZ1tmcFFZliG+M 0qj+FFuBbiSDixGLGivgKWmJcRgM0IQZThrOLz1dE5Vy2GBNArxwuSL X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= 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, 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 s390 does not support the "global" stack protector mode that is implemented in nolibc. Now that nolibc detects if stack protectors are enabled at runtime it could happen that a future compiler does indeed use global mode on and nolibc would compile but segfault at runtime. To avoid this hypothetic case and to align s390 with the other architectures disable stack protectors when compiling _start(). Signed-off-by: Thomas Weißschuh --- tools/include/nolibc/arch-s390.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/include/nolibc/arch-s390.h b/tools/include/nolibc/arch-s390.h index a738e7f3f8e8..516dff5bff8b 100644 --- a/tools/include/nolibc/arch-s390.h +++ b/tools/include/nolibc/arch-s390.h @@ -8,6 +8,8 @@ #include #include +#include "compiler.h" + /* The struct returned by the stat() syscall, equivalent to stat64(). The * syscall returns 116 bytes and stops in the middle of __unused. */ @@ -164,7 +166,7 @@ char **environ __attribute__((weak)); const unsigned long *_auxv __attribute__((weak)); /* startup code */ -void __attribute__((weak,noreturn,optimize("omit-frame-pointer"))) _start(void) +void __attribute__((weak,noreturn,optimize("omit-frame-pointer"))) __no_stack_protector _start(void) { __asm__ volatile ( "lg %r2,0(%r15)\n" /* argument count */ --- base-commit: d5d0994c2f3cae2d2bdc04b98c6212e72efe0509 change-id: 20230524-nolibc-stackprotector-s390-0bc5c197ff6f Best regards, -- Thomas Weißschuh