From patchwork Thu Dec 26 17:57:44 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: 853702 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4893919wrq; Thu, 26 Dec 2024 10:03:33 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVtbgyCVjtKqONPR5mmnX0BHM2YBDL1xYcF+LzEj7K0o+6yndbHGeAPUia4QkwlScw4dXQDOA==@linaro.org X-Google-Smtp-Source: AGHT+IGSCq41ovsl9Sj5wEsH8j7XWKvAwBwvMg6DbUsC9nc7tCm3ggIRPLW1CXvteCEu+Mfp+AaA X-Received: by 2002:a05:620a:4452:b0:7b6:6a3b:539b with SMTP id af79cd13be357-7b9ba73895emr3947498685a.17.1735236213634; Thu, 26 Dec 2024 10:03:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1735236213; cv=pass; d=google.com; s=arc-20240605; b=MxZaVip9mMI/E/QY1Q61jY2nCGMsycqqhT/xg2spO48vQN6YFxEeWkaxRKi4khhosm Z47tsmsM2uoiiXMCejuqhDp4rWTFqzcDBolAELndzdFVI2lDZFqDOYoW07ySXuVFn9ks 6wxyns5iEMrvgy1DRAUCntKKllLtUuTKOi1iBVvW1pDOcRQmwqogC23WlVOeoJuCRCgl SQsm7aEsZBJe1Omz0eoKn7PReC03ENtf37m1nLUWgjcbN+4F74f3mTd2m0z6TF1SGkV2 HSF9E6kjkp52u1DcBbAbEt4NBueheP1nOjK1NU2MzNWdHyfTdQXnGWwV2rX+eEXrTGY2 d2nA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dkim-filter:arc-filter:dmarc-filter :delivered-to:dkim-filter; bh=bFqJlhND8ZbiwHoe/6DHdYTaWgb4vpDDDS2F9cj18B0=; fh=xV8Gp349bHw1ljD2lFQRwhGaJ4bIEzpeFyS/N97S3Sw=; b=FNphsbIFu4rIUMf2VUlIgSeudMGZcKcc/XNGjwdyru6FHZcyFVwODDUVJjhGoDumnB VYX2CYm38qPTSBhVsWSTSBlibY1lAU1iyJDaoKzOME+l6o3nvMbyiqxpXMR5SCsQo/Ou fUYCPyYdbsOxnMJ7RnokhJc0xtZtQYv2AZDUob2U2h1UbFtnoow9Ipn0jij0ZO5Wa15B SvdMn3fh/QOviDI3KVLO5qysLx1p78sDpaQax1mePEa+Dgx+ntqfz+c4QfG6Jw8yv7q1 NxC42u34jOff6TJXsA72W7YIpWPf2ZEUhZ47urBBWOt3pnAa1nanXtM0KYBl4gnDdPYn jeKw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XwqTTCUI; 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-7b9ac4ce805si1888109485a.427.2024.12.26.10.03.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Dec 2024 10:03:33 -0800 (PST) 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=XwqTTCUI; 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 367243858C48 for ; Thu, 26 Dec 2024 18:03:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 367243858C48 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=XwqTTCUI X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by sourceware.org (Postfix) with ESMTPS id 292013858C51 for ; Thu, 26 Dec 2024 17:58:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 292013858C51 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 292013858C51 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::636 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1735235929; cv=none; b=R2D9s7te3mIePufC+C6ZINiketKpzn3AuA+g7xPBI/wG2Ci3CaUui/kQ3ML78lWAbEKYUA27bYwDPfx+NMuxYZXiId1QaSKi4fOhXxIbva1gxG7d3DQwyZW9YLkQkFXzNJaFzlaSLRFOOiFbX5tI8NLR/UG80sFFBHMJGT7Aw08= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1735235929; c=relaxed/simple; bh=NhreY4py9k6vBO0fulaO6qTa2bn3uqToEzZ2jDAmm3c=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=fqmjfzHAkD/luDNbLJsTpS77VyIBv6fhf6CeHopTspRAiRVXXZSbgrnmT+tOUGLQ7Ph5AlBVslaX5mvpoWqUCeq6zqI+rjbYuiuuvcgTadV4vLIW2e/+Oo5bIZ8yPQx4gWqeY7bLs4o9+NT5G3u/pCYUdbeG6PDLpcvcpy29MRQ= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 292013858C51 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-2161eb95317so80130655ad.1 for ; Thu, 26 Dec 2024 09:58:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735235928; x=1735840728; darn=sourceware.org; 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=bFqJlhND8ZbiwHoe/6DHdYTaWgb4vpDDDS2F9cj18B0=; b=XwqTTCUI3Z+O5rFEs7NArYKKHo9Gfk1O0ZSowM81ywEYVg4cwOh9scRD+8906Y7bTz EsJxlqN2pzVkgxibP024WCdA4oE/jID0CKxnxRrICWqpAagoGvgSMLzzjfcLtAyuL9eP TYYRi3WjfuyRKES4hifSLkETVtkM0cnOseJJNHbhipjwsWtJOSD11Ncg+HdWSnXI7auq FjtjR3GNrs1kQc0FklNWYl4jI78goV+ZTB5V8RiP5GH9Tz3G5OagnMKjFWroRq8dLL8c Wb7vzrNCBZPDgefmGLUnDqCXABzMpDdQk+4iGcM+BcTX/xkDDpveq88xdrdQQgTFKVa/ QnJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735235928; x=1735840728; 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=bFqJlhND8ZbiwHoe/6DHdYTaWgb4vpDDDS2F9cj18B0=; b=WM6CbsRXHvdBzRLcx9xn8xOoHy4tmyrr9rFxX9B7iMr85DnzSxK4SR6OWgltcRt/RH jnoDZLsKOg7deZHNyI4AUGixE949qD3a+UZf5B4iwl6qzLUvSXNyvraY87sghLFLBQmW KF1zaeIbw0CM/usUZJe0AjeAYbyWsd0+jW3KS3ncRLn2mAoi1LJ7mDpEqGW9BkoBRXRv hQBpuqbqeClOAMIUMAfNos6AQ2Bi/Z/HVfk6xDuyE6JK43jqhEtUNpXKRsX3K+BsVNE5 dP2wqDdg4XLAfTSz0PQnUu01uw34mpn9IppsF/SP3lmUd0IsqQOQu825NnDyKX/9ks0B 8n4A== X-Gm-Message-State: AOJu0YxfmFLk28hCFPbAYOte373r57UVDMBLqcd2m6EHS1RTzdEFEst/ 1M5mfg20K45cehgzY98pY/Pbq58NrFBJhd3kqJZzKPlXLRKYK+P3tWDurRkde2NomVAqrKOhnTv g X-Gm-Gg: ASbGncuMgnFFb7Df7qJw76A3r/Yj2Hm2Wus97hXB1d5W821UGmtBYBtPuqsbyODMmIt eworZuocrw8blHrOK7EasHF6i6KZUE0EcVLjOTvjPvsD0TjQpEecdWMwBseZZsk7TX5eR235Eqm fKsk7pHP/bQkHbuoJYAdXJ9yWgco6wklJsQ5rcaO+v9cqCc0tpjDHTH20Sn5mjK0FBiRqqYrINJ ehj+NdGvGJ8mjahl4rCg+gLJG3/ZG38mMzdHI+GlT8BfRtNFeJNGrlW+2p0wXiHa8o0VR74CLOt AnDP5n+ooOM43C6a+TXdrIz+7Xwd X-Received: by 2002:a17:902:cece:b0:216:282d:c697 with SMTP id d9443c01a7336-219e6ebae8amr259779655ad.27.1735235927644; Thu, 26 Dec 2024 09:58:47 -0800 (PST) Received: from ubuntu-vm.. (201-92-184-234.dsl.telesp.net.br. [201.92.184.234]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dca031besm119484645ad.281.2024.12.26.09.58.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Dec 2024 09:58:47 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Florian Weimer , Adhemerval Zanella Subject: [PATCH v7 3/4] elf: Add tst-execstack-prog-static Date: Thu, 26 Dec 2024 14:57:44 -0300 Message-ID: <20241226175834.2531046-4-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241226175834.2531046-1-adhemerval.zanella@linaro.org> References: <20241226175834.2531046-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 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 Similar to tst-execstack-prog, check if executable stacks works for statically linked programs. Reviewed-by: Florian Weimer --- elf/Makefile | 7 +++++++ elf/tst-execstack-prog-static.c | 1 + 2 files changed, 8 insertions(+) create mode 100644 elf/tst-execstack-prog-static.c diff --git a/elf/Makefile b/elf/Makefile index e8fc6bd65f..cea48e9537 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -567,6 +567,9 @@ tests-execstack-yes = \ tst-execstack-needed \ tst-execstack-prog \ # tests-execstack-yes +tests-execstack-static-yes = \ + tst-execstack-prog-static + # tests-execstack-static-yes endif endif ifeq ($(have-depaudit),yes) @@ -662,6 +665,7 @@ $(objpfx)tst-rtld-dash-dash.out: tst-rtld-dash-dash.sh $(objpfx)ld.so $(evaluate-test) tests += $(tests-execstack-$(have-z-execstack)) +tests-static+= $(tests-execstack-static-$(have-z-execstack)) ifeq ($(run-built-tests),yes) tests-special += \ $(objpfx)tst-ldconfig-X.out \ @@ -1982,6 +1986,9 @@ LDFLAGS-tst-execstack-needed = -Wl,-z,noexecstack LDFLAGS-tst-execstack-prog = -Wl,-z,execstack CFLAGS-tst-execstack-prog.c += -Wno-trampolines CFLAGS-tst-execstack-mod.c += -Wno-trampolines + +LDFLAGS-tst-execstack-prog-static = -Wl,-z,execstack +CFLAGS-tst-execstack-prog-static.c += -Wno-trampolines endif LDFLAGS-tst-array2 = -Wl,--no-as-needed diff --git a/elf/tst-execstack-prog-static.c b/elf/tst-execstack-prog-static.c new file mode 100644 index 0000000000..328065dd9c --- /dev/null +++ b/elf/tst-execstack-prog-static.c @@ -0,0 +1 @@ +#include