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 X-Patchwork-Id: 804153 Delivered-To: patch@linaro.org Received: by 2002:a5d:6545:0:b0:35b:5a80:51b4 with SMTP id z5csp294273wrv; Fri, 14 Jun 2024 05:53:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUa8FBe8KSAIcd/2vpWobSzfe3HIj/NSAR3gi2wSTp0oq265gXOJMTw7y1zLBI8oTaUyv7meVmv7jk3TbAKawi2 X-Google-Smtp-Source: AGHT+IEt2zjBVkea0kAxGBKmZrIzZKpyig+tUi4FmT+pQ9khZZL1x/97lkXwOiGfqOF5cXvF31AV X-Received: by 2002:a05:620a:2699:b0:796:7c8f:e660 with SMTP id af79cd13be357-798d258e26cmr229618785a.56.1718369598652; Fri, 14 Jun 2024 05:53:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718369598; cv=pass; d=google.com; s=arc-20160816; b=OsjT28FAagGX85nNOU60LGWFVurukgrMD/tsroZEQniXS83qjz6vB2A732/Ofy0mdT c58+bM7Kqm6q8V87f1I+qu8QMv6LP9ruU1sYU0K1ecP0zS3RJCQq9eDDfdX7QmCbZXyz N8CXfVJt8iYk6p//og1Slm//CaWB5enjcpgRLVvLxWex94XRGvfLOo3WqDDBSJ9AvSlW CWBWg/AaeN53kKbIoZuhoQA9fJqQITZjpL0mDAynviL1+Vtp0u8eZzn2CiE8c6h9X8zu 7mk9SxMAfa09dG2GOyfMtyJkKkGtDchoIOt5Ro+2xdEMmoZcKSGftVsIflHUxmupSBct v+Rw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=wWd+LGTmq9CTIimMEtdkugZEAsDIb/SHZ3JxseJJs/A=; fh=GBLwcZa3Ar5g+0nFTVWUSbowptRVTzvTc/MV+A3rhh4=; b=jZc8A/xIAm4U7JrUQCaAQQp3VI1cKCZc9Sd0S8UGw/ywB1czxqL4fUCNb50TL2WyhV DVm9JmTBqnbKZPQshDILCaSko81he8CcOq2d55Ayvhkyo8j1ZJvt520Avk0vzhlZ+yc4 /E7gqhNMblZ2ngmQBG+L7IIp5ljx+OyIjjZYR7wlsF1LKTMG1p3f1OIgylm8sVsf2Fqo SGDmlWrJAO/59Erx5NSLnJV/EUeyEcvlTt3lPOc8yVqfoDW6l9VReZExJKRCcyLTC9ey jk5t/+Fp3proSH4XcE323pgR5T+1R17vkhJvTURS0/isYV0SqRTcqltMoXVPnvO/kz4B K7Mw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZzoRbX2T; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id af79cd13be357-798abe58814si358044285a.592.2024.06.14.05.53.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 05:53:18 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZzoRbX2T; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 47D0B3882155 for ; Fri, 14 Jun 2024 12:53:18 +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-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+patch=linaro.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