From patchwork Fri Jun 14 12:50:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 1947918 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=ZzoRbX2T; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W0zjX1sSzz20Pb for ; Fri, 14 Jun 2024 22:53:36 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A2EC6388264F for ; Fri, 14 Jun 2024 12:53:28 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 665E7388206F for ; Fri, 14 Jun 2024 12:53:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 665E7388206F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 665E7388206F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::42c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718369588; cv=none; b=gzACUv0cLuut30nHGKUG4N6fmX2zgS0HSJ+ZxsE1TozL7dRr7gDpgM7S/S0z4qjLzMbZZoEe2ZFyljJb01E2l5BSQKjhtiirL1jUTo5ipa2MHCOugCGKZ/yrPCTgGLwEB3Hdi8EsTLAqDaI5PypKDd08IwPYBRO8xPZYkCJu9TM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718369588; c=relaxed/simple; bh=UvNlSzs/wuZdyXXuBvgWvEt3xwuLXu7orMG4q8Pb5kk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=HYa9uOsC/TlUBqTbQDt5MX6uewIrspjPIAX95bcyZrjT9Lmy12srt65zrDKTp3v9wLMaVXRgS8CZUUzPF50arR9I4uDATnx2+OusB/RkOnZp7ZFc7N+hjBNNpmFMms9GQTDDDxHTpDky40o9MOQce/ZBsaKXR4tBEBAN1cTDU1w= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-7042882e741so1793657b3a.2 for ; Fri, 14 Jun 2024 05:53:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718369585; x=1718974385; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=wWd+LGTmq9CTIimMEtdkugZEAsDIb/SHZ3JxseJJs/A=; b=ZzoRbX2T+XiWcAnATZi0zU9gqDOXX3DNZmfQAt8LSkq43Y9J6tacQAU1m0U6Cw5j4L 8htlcHhvDatAhP2WQOeTIFOn1Up3a2tkrqFQYnWMwzMOaYOTBwcBGl/fspTaYg5yIH0w lCKhhfHrKIxXXkH0TmB7VqFeyjc3YnQZ9uBPd8XWNSyx9KjaEt9eX2CeD4EOuC4hBfsA sliARwT940LaUijIPXxK68HVO+BmruUrGptslWsjuhdaZg7Pkrln62RArRUtQxEYYFL3 f7oz1cY1yIg+PDqHG4TLbzH39Cf0NT4Mp9SFvtrrqkU+a7qlfyaNkRz/ZFw/sRwQAbBQ U+Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718369585; x=1718974385; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wWd+LGTmq9CTIimMEtdkugZEAsDIb/SHZ3JxseJJs/A=; b=hdSeATPv5IGvQTFMs+f9w3C4XnbgbsXa5ieVkRt5IsalO6ek2CRes3Ow5jNyONrYu2 01XgW8JUvAGPhmWApbbe9xXdLRmiwXFW4K3YwGI/tIkalr0l1rp8w4JxLLA5oeVkbkQi GNXlR2PsLIvj7Qr+69HX6VcbQtgU+Ho5EB0nsiNOiHEwHPe4kA2hjkqqixUR8Rtzkx/e d0Hit6H6StxnwK+U+dS2MfZ0m1ATX2sWkm/6MswBnjbn+J7JFGbX21ORCf8QBABfANi/ suVxixXFmZRWtp9dzKgYS1jFrQBPBg6mhFT4PqFgSleVLV6MCk52LmXNkej6QK9RHC/3 saPA== X-Gm-Message-State: AOJu0Yw0QzuVe9/+N7FwqBXHE+8e4mdoJO/H+iwYzjcV55CfN01I6iU2 cSoo7yrC6M4ouCOI2R+t/3eT4RlHbuR+jD69HufsPvs8X/2D2QHc8kaWD/NB3yXCxi8VP7335tA U X-Google-Smtp-Source: AGHT+IGYNGL1dYIzecY7fKfMnAnp7D5vaDlHffzA0Pu+a6p2tl16aSyYbCUf2f34+aL/F2YR56zhXQ== X-Received: by 2002:a05:6a00:4d96:b0:702:608c:215f with SMTP id d2e1a72fcca58-705d71c4502mr2046939b3a.29.1718369584808; Fri, 14 Jun 2024 05:53:04 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c0:c5fb:2445:b09c:5736:f9f6]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-705cc9890d5sm3062140b3a.92.2024.06.14.05.53.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 05:53:04 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: "H . J . Lu" , Florian Weimer , Zack Weinberg Subject: [PATCH v2 0/2] Make non-executable stack disable by default Date: Fri, 14 Jun 2024 09:50:50 -0300 Message-ID: <20240614125300.310236-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, 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 server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org First patch is a stackinfo.h cleanup for better default, while the second is the patch to disable executable stacks. Changes from v1: * Fixed tests invocation without --enable-hardcoded-path-in-tests. * Added hurd, hppa, mips exceptions. Adhemerval Zanella (2): elf: Consolidate stackinfo.h elf: Make non-executable stack disable by default Makeconfig | 1 + NEWS | 4 + elf/Makefile | 50 ++++++++- elf/dl-load.c | 8 ++ elf/dl-support.c | 5 + elf/dl-tunables.list | 6 + elf/rtld.c | 4 + elf/tst-execstack-prog-static.c | 1 + elf/tst-execstack.c | 106 +++++------------- elf/tst-ro-dynamic-mod.map | 3 +- elf/tst-rtld-list-tunables.exp | 1 + manual/tunables.texi | 20 ++++ nptl/Makefile | 11 +- sysdeps/aarch64/stackinfo.h | 33 ------ sysdeps/arc/stackinfo.h | 33 ------ sysdeps/csky/stackinfo.h | 29 ----- sysdeps/generic/stackinfo.h | 15 ++- sysdeps/hppa/dl-tunables.list | 11 ++ sysdeps/loongarch/stackinfo.h | 33 ------ sysdeps/mach/hurd/dl-tunables.list | 11 ++ sysdeps/nios2/stackinfo.h | 33 ------ sysdeps/powerpc/{ => powerpc32}/stackinfo.h | 8 +- sysdeps/riscv/stackinfo.h | 33 ------ sysdeps/unix/sysv/linux/mips/Makefile | 13 +++ .../sysv/linux/mips/dl-tunables-arch.list | 12 ++ 25 files changed, 201 insertions(+), 283 deletions(-) create mode 100644 elf/tst-execstack-prog-static.c delete mode 100644 sysdeps/aarch64/stackinfo.h delete mode 100644 sysdeps/arc/stackinfo.h delete mode 100644 sysdeps/csky/stackinfo.h create mode 100644 sysdeps/hppa/dl-tunables.list delete mode 100644 sysdeps/loongarch/stackinfo.h create mode 100644 sysdeps/mach/hurd/dl-tunables.list delete mode 100644 sysdeps/nios2/stackinfo.h rename sysdeps/powerpc/{ => powerpc32}/stackinfo.h (82%) delete mode 100644 sysdeps/riscv/stackinfo.h create mode 100644 sysdeps/unix/sysv/linux/mips/dl-tunables-arch.list