From patchwork Mon Feb 10 19:40:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 863821 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e42:0:b0:385:e875:8a9e with SMTP id r2csp1768382wrt; Mon, 10 Feb 2025 11:41:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWyVk1vD9hPNGLbZTNdKQ7lH7rv8VlFDGyezJys/8c8WnKoTbYs31Nqk26SV8YaI7E3y45clQ==@linaro.org X-Google-Smtp-Source: AGHT+IFtwc1mujFon31u1rUdIHU16zPNs3/yqea+myJQUaCI0YA3qLK4SnX9rOLYzl6wwdSAmD8o X-Received: by 2002:a05:6902:2509:b0:e48:5b35:af2e with SMTP id 3f1490d57ef6-e5b46255280mr11482258276.33.1739216481754; Mon, 10 Feb 2025 11:41:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1739216481; cv=pass; d=google.com; s=arc-20240605; b=gh/Z/B1K1OqRZaziGn3XoZXB6+kjp1R4+v2oE14BN3Aj6prN7XCtLvINexvIBkz71s puFCdlxXn4AABWXZ3OJjCztvOZLsoOj0bFPJ7M/E2+k2ceA9onEkdxVqvjLsyu4Brxfq zB7eAPf+RftLOXSGcLmiIipqIa6mPaP1IECaOIGrCgEUt2Zq4ohWtw4/lAF45YkT39aG ABqvVV23QXa+wcTHKiDo5m/m5AsqgT6I/UikfuoZaWUWorgnTu3E6lp3peM2djTBbM/a VLBLNU7a4ro3O9wRlACEsAI+kKEjNH0BqIf7Bb2IvgG1mJl046K8EwEAFbi6rLg+I0l1 sX9w== 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:message-id:date:subject:cc:to:from:dkim-signature :dkim-filter:arc-filter:dmarc-filter:delivered-to:dkim-filter; bh=7MaGmdGHvmpTo19GQ44FBnHrn+j+GYdeQ3wqokZ11Bs=; fh=rCa3ppVe5iCiIg2hlr/ZWmuMjHCO35lkvmJd+GFan0o=; b=ji+Emo8S0RftD1Tsemn8DksS3f2AK+jd0Yqo71FT6u+8jzyKprfV5TUF7C+B9HGmQc uRKKbVhSRI9cCDHlwzJ8ocVPfpfplxwFMBdyyQZ0PlxTIeBs2LJoTTmk+LzbruQo1u+F M/FTExRR2dcra1yq1aCHZjyXr0un7x4vLJqWzQJFECE9zYM1adXh8BFIXVpFdEMDC3ON SyKaqkNlNO8JWCms6HuTNvVsPjP0mHoVZ24u3nXpdH7n6LHlBB3edckVvx8iVTzZy9/g dbdG3qoHp1vdap81/ayBSV8rq213ZhkhRvLQuMiEqdJGwcejV2V2TP1ss+xnPqUqYAcM K60Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ayfUw2gV; 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 3f1490d57ef6-e5b3a48d1f8si9548263276.534.2025.02.10.11.41.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Feb 2025 11:41:21 -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=ayfUw2gV; 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 3DBDD3858424 for ; Mon, 10 Feb 2025 19:41:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3DBDD3858424 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=ayfUw2gV X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by sourceware.org (Postfix) with ESMTPS id 00A913858C56 for ; Mon, 10 Feb 2025 19:40:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 00A913858C56 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 00A913858C56 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1029 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1739216439; cv=none; b=b1QjD+7lGCWvy6uW2DBT5yyec7DOz68RAmnDJrah4ufh0vYoW2CKQYOy5NrlwRqrMjP+ti0EziSTUs0bjbDMDaE6CE6y4AHDmW006H/iE8/ZHJ16GBIebmlyaj8OF1mtl3M8GyI49rE4kTfjVFk9XQ14bsmow4lB85d/23S9YyM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1739216439; c=relaxed/simple; bh=IahDi6OaAGxAwmBLDm4tc26EsXgXcKvWV2ubIlKNQFk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ANag+OHOOk4LofmiKbKMP3bq6JQc136qPu62nhydfJl7ppwCX16wODUwWqUcNdQ6lk5Q1X8HO4/WLcQ7fd43Mklv/96MYIzlVDp3F0+9jeS2wE1g7ErWYqwWwmV2v4oB01bzJ16g4toxEOehf4VVwuA14Ok82Oj/AxgDgBHqbfc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 00A913858C56 Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-2fa51743d80so3021254a91.2 for ; Mon, 10 Feb 2025 11:40:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739216437; x=1739821237; 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=7MaGmdGHvmpTo19GQ44FBnHrn+j+GYdeQ3wqokZ11Bs=; b=ayfUw2gV3tjOdziAGMLu5RaX6+U6Cf0r+BubwpW7HpuHXEXTOAlb8WnmO5AJNIRuME iYvzyn6YkwDHuy9SHHgp6Mt2hMrlsmHGM12z1IXELYEd3Tth1KbYrrygu8sKGH8BJD/p r8hRSCPmewAvqr+BM3JTsL6Zf6sX6n42u9KGtB+PJkVa/RuTvZCbL8ZR8HF7kanBidLy QQhe090a1VmWlslEGK4Is0EXXLvLk1Ncot7Pi8U6J0tx99vmygeFXPhDW1+zBC23urij L/Qy/pmAD7nH2Ik/AbRINGvg3NXZDF+A07KuPlIk09auDzZ7YiSmm3SO5P/wQOGOF1I4 4RUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739216437; x=1739821237; 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=7MaGmdGHvmpTo19GQ44FBnHrn+j+GYdeQ3wqokZ11Bs=; b=lX48qvrorimokUVU0WSL/buvgPm4ZCEV3NPCCmHeB1P7Ce3pUzlUQ2NwMv/BrhsiHb IdVBuQz23qRdHbEkMgoGUItl6DU5rxwAUv6vcQ/DNvGE7lB86BAlov1Y6h24hL5E1DHx /4WklcUR6KgWyC6HtdrUw6nIH3VLgzy3OKXp28mLHP8sFZfsAtaPGEQqUU/fJZHBVL/b PdlRylyfG5ecE52/tluT/1qihj96bGGncDBYLq3JiEOrP/FSMV7J5rzEVN4J1ej6AQek 6lD8uMyXx+es+PCTw5w6hvGM/OMROGr/3OG8hF5bZ6SUvDN4Lkc0xa0mJ0WSyFZbNhjz YSbA== X-Gm-Message-State: AOJu0Ywy9Va+6XW//ZKMNmUET6qEYcznGz3zxXCFY63PqxSswHdDnMZV WaA1oXmq+hAN7/q6UA9SeQrpC/0nDC7hqQu4f32x8t28JDZwZ696GoojWoDtTSUNNcx59sKTXiT Z X-Gm-Gg: ASbGncuNGu81NBNnrw5sGZFpvRe3ZoC5FE53+logn32aY5G9a1uV5KQ9nJPyaGHW77b yPbjjtnzaSHf8wioOnFxrRnJJpVg6AWvUwzmpcgui4h6zR/HrIUuSbxCyhcqPkRaJ1V9ZwSZUSV m10hXUoJvuE6koUSwlQ26xL0Z9gbmG+E8G+O08+Qn5fI2G5FRNobQw6SE7s0vfoMxtnPHx2u3dL SHKW9aZluj+VkJ7HdKFweijWjCJnje6vsQb9EiTljHVCjrTNpNfa5mOpdO9NP0iJPAepV72R3I9 Y0MPFIq0wiUn7LNCk1eQVXkCOiyd X-Received: by 2002:a17:90a:f94f:b0:2ee:96a5:721c with SMTP id 98e67ed59e1d1-2fa2417c12fmr20784056a91.21.1739216436836; Mon, 10 Feb 2025 11:40:36 -0800 (PST) Received: from mandiga.. ([2804:1b3:a7c2:c933:6ede:a43f:9b59:5001]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21faa495d5dsm11649945ad.111.2025.02.10.11.40.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Feb 2025 11:40:36 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Sam James , Florian Weimer , Ethan Lee Subject: [RFC v2] elf: Extend glibc.rtld.execstack tunable to force executable stack (BZ 32653) Date: Mon, 10 Feb 2025 16:40:13 -0300 Message-ID: <20250210194026.3388341-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.43.0 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 >From the bug report [1], multiple programs still require to dlopen shared libraries with either missing PT_GNU_STACK or with the executable bit set. Although, in some cases, it seems to be a hard-craft assembly source without the required PT_GNU_STACK mark (so the loader is forced to set an RWE), other cases seem that the library uses trampolines [2]. Unfortunately, READ_IMPLIES_EXEC is not an option since on some ABIs (x86_64), the kernel clears the bit, making it unsupported. To avoid reinstating the broken code that changes stack permission on dlopen (0ca8785a28), this patch extends the glibc.rtld.execstack tunable to allow an option to force an executable stack at the program startup. The tunable is a security issue because it defeats the PT_GNU_STACK hardening. It has the slight advantage of making it explicit by the caller, and, as for other tunables, this is disabled for setuid binaries. A tunable also allows us to eventually remove it, but from previous experiences, it would require some time. Checked on x86_64-linux-gnu and i686-linux-gnu. [1] https://sourceware.org/bugzilla/show_bug.cgi?id=32653 [2] https://github.com/conda-forge/ctng-compiler-activation-feedstock/issues/143 --- I am marking this a RFC because I am not about the security implications. The glibc 2.41 with 0ca8785a28 fixed a long standing security issue where some security guarantee were being change during process execution, while still enforcing the PT_GNU_STACK during process execution. This compatibility removes the enforcement, since user may override the PT_GNU_STACK with an environment variable. This in theory is a hardening drowgrade, but this is also what users seems to be doing with execstack to override the binary PT_GNU_STACK. --- csu/libc-start.c | 3 ++ elf/dl-tunables.list | 2 +- elf/rtld.c | 1 + elf/tst-rtld-list-tunables.exp | 2 +- manual/tunables.texi | 10 +++-- sysdeps/generic/ldsodefs.h | 4 ++ sysdeps/unix/sysv/linux/Makefile | 19 +++++++++ sysdeps/unix/sysv/linux/dl-execstack.c | 29 ++++++++++++-- .../unix/sysv/linux/include/sys/personality.h | 12 ++++++ .../linux/tst-execstack-tunable-execstack.c | 1 + .../linux/tst-execstack-tunable-skeleton.c | 39 +++++++++++++++++++ .../unix/sysv/linux/tst-execstack-tunable.c | 1 + 12 files changed, 114 insertions(+), 9 deletions(-) create mode 100644 sysdeps/unix/sysv/linux/include/sys/personality.h create mode 100644 sysdeps/unix/sysv/linux/tst-execstack-tunable-execstack.c create mode 100644 sysdeps/unix/sysv/linux/tst-execstack-tunable-skeleton.c create mode 100644 sysdeps/unix/sysv/linux/tst-execstack-tunable.c diff --git a/csu/libc-start.c b/csu/libc-start.c index 6f3d52e223..7a13961b18 100644 --- a/csu/libc-start.c +++ b/csu/libc-start.c @@ -307,6 +307,9 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL), #endif /* !SHARED */ + /* Make the thread executable if required. */ + GLRO(dl_check_executable_stack) (); + /* Register the destructor of the dynamic linker if there is any. */ if (__glibc_likely (rtld_fini != NULL)) __cxa_atexit ((void (*) (void *)) rtld_fini, NULL, NULL); diff --git a/elf/dl-tunables.list b/elf/dl-tunables.list index 0b6721bc51..c03c9967f0 100644 --- a/elf/dl-tunables.list +++ b/elf/dl-tunables.list @@ -138,7 +138,7 @@ glibc { execstack { type: INT_32 minval: 0 - maxval: 1 + maxval: 2 default: 1 } } diff --git a/elf/rtld.c b/elf/rtld.c index 115f1da37f..573197a484 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -372,6 +372,7 @@ struct rtld_global_ro _rtld_global_ro attribute_relro = ._dl_error_free = _dl_error_free, ._dl_tls_get_addr_soft = _dl_tls_get_addr_soft, ._dl_libc_freeres = __rtld_libc_freeres, + ._dl_check_executable_stack = _dl_check_executable_stack, }; /* If we would use strong_alias here the compiler would see a non-hidden definition. This would undo the effect of the previous diff --git a/elf/tst-rtld-list-tunables.exp b/elf/tst-rtld-list-tunables.exp index 9f5990f340..8df6f5906e 100644 --- a/elf/tst-rtld-list-tunables.exp +++ b/elf/tst-rtld-list-tunables.exp @@ -13,6 +13,6 @@ glibc.malloc.top_pad: 0x20000 (min: 0x0, max: 0x[f]+) glibc.malloc.trim_threshold: 0x0 (min: 0x0, max: 0x[f]+) glibc.rtld.dynamic_sort: 2 (min: 1, max: 2) glibc.rtld.enable_secure: 0 (min: 0, max: 1) -glibc.rtld.execstack: 1 (min: 0, max: 1) +glibc.rtld.execstack: 1 (min: 0, max: 2) glibc.rtld.nns: 0x4 (min: 0x1, max: 0x10) glibc.rtld.optional_static_tls: 0x200 (min: 0x0, max: 0x[f]+) diff --git a/manual/tunables.texi b/manual/tunables.texi index 7f0246c789..5c96fae769 100644 --- a/manual/tunables.texi +++ b/manual/tunables.texi @@ -365,8 +365,11 @@ change the main stack permission if kernel starts with a non-executable stack. The @code{glibc.rtld.execstack} can be used to control whether an executable stack is allowed from the main program. Setting the value to @code{0} disables the ABI auto-negotiation (meaning no executable stacks even if the ABI or ELF -header requires it), while @code{1} enables auto-negotiation (although the -program might not need an executable stack). +header requires it), @code{1} enables auto-negotiation (although the program +might not need an executable stack), while @code{2} forces and executable +stack during initialization (this is provide for compatibility reasons, where +the program requires to dynamically load modules with executable stacks with +@code{dlopen}). When executable stacks are not allowed, and if the main program requires it, the loader will fail with an error message. @@ -380,7 +383,8 @@ of hardware capabilities and kernel configuration. @strong{NB:} Trying to load a dynamic shared library with @code{dlopen} or @code{dlmopen} that requires an executable stack will always fail if the main program does not require an executable stack at loading time. This -is enforced regardless of the tunable value. +can be disable by setting the tunable to @code{2}, where the stack is +always executable. @end deftp @node Elision Tunables diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h index 8465cbaa9b..caed31e17f 100644 --- a/sysdeps/generic/ldsodefs.h +++ b/sysdeps/generic/ldsodefs.h @@ -671,6 +671,8 @@ struct rtld_global_ro /* Called from __libc_shared to deallocate malloc'ed memory. */ void (*_dl_libc_freeres) (void); + int (*_dl_check_executable_stack) (void); + /* Implementation of _dl_find_object. The public entry point is in libc, and this is patched by __rtld_static_init to support static dlopen. */ @@ -707,6 +709,8 @@ extern const ElfW(Phdr) *_dl_phdr; extern size_t _dl_phnum; #endif +int _dl_check_executable_stack (void) attribute_hidden; + /* This function changes the permission of the memory region pointed by STACK_ENDP to executable and update the internal memory protection flags for future thread stack creation. */ diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 395d2d6593..8161b3d4c8 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -681,6 +681,25 @@ tests-special += \ $(objpfx)tst-nolink-libc-2.out \ # tests-special endif + +ifeq ($(have-z-execstack),yes) +tests += \ + tst-execstack-tunable \ + tst-execstack-tunable-execstack \ + # tests + +# Re-use the module with an executable stack from elf/Makefile +$(objpfx)tst-execstack.out: $(objpfx)tst-execstack-mod.so +$(objpfx)tst-execstack-execstack.out: $(objpfx)tst-execstack-mod.so + +# Also check if the tunable works on a program with an executable stack +# (it should be a no-op). +LDFLAGS-tst-execstack-tunable-execstack = -Wl,-z,execstack + +tst-execstack-tunable-ENV = GLIBC_TUNABLES=glibc.rtld.execstack=2 +tst-execstack-tunable-execstack-ENV = GLIBC_TUNABLES=glibc.rtld.execstack=2 +endif + endif # $(subdir) == elf ifeq ($(subdir),rt) diff --git a/sysdeps/unix/sysv/linux/dl-execstack.c b/sysdeps/unix/sysv/linux/dl-execstack.c index 9791b339ca..a8fa21dfda 100644 --- a/sysdeps/unix/sysv/linux/dl-execstack.c +++ b/sysdeps/unix/sysv/linux/dl-execstack.c @@ -17,9 +17,10 @@ . */ #include +#include -int -_dl_make_stack_executable (void **stack_endp) +static int +make_stack_executable (void **stack_endp) { /* This gives us the highest/lowest page that needs to be changed. */ uintptr_t page = ((uintptr_t) *stack_endp @@ -35,11 +36,31 @@ _dl_make_stack_executable (void **stack_endp) ) != 0) return errno; + /* Remember that we changed the permission. */ + GL(dl_stack_flags) |= PF_X; + + return 0; +} + +int +_dl_make_stack_executable (void **stack_endp) +{ + int r = make_stack_executable (stack_endp); + if (r != 0) + return r; + /* Clear the address. */ *stack_endp = NULL; - /* Remember that we changed the permission. */ - GL(dl_stack_flags) |= PF_X; + return r; +} +int +_dl_check_executable_stack (void) +{ + if (TUNABLE_GET (glibc, rtld, execstack, int32_t, NULL) == 2) + /* We can't clean the __libc_stack_end because it is marked as RO + when this function is called. */ + return make_stack_executable (&__libc_stack_end); return 0; } diff --git a/sysdeps/unix/sysv/linux/include/sys/personality.h b/sysdeps/unix/sysv/linux/include/sys/personality.h new file mode 100644 index 0000000000..794047a488 --- /dev/null +++ b/sysdeps/unix/sysv/linux/include/sys/personality.h @@ -0,0 +1,12 @@ +#ifndef _INCLUDE_SYS_PERSONALITY_H +#define _INCLUDE_SYS_PERSONALITY_H 1 + +#include_next + +# ifndef _ISOMAC + +extern __typeof (personality) __personality __THROW; +hidden_proto (__personality) + +# endif /* _ISOMAC */ +#endif /* sys/sysinfo.h */ diff --git a/sysdeps/unix/sysv/linux/tst-execstack-tunable-execstack.c b/sysdeps/unix/sysv/linux/tst-execstack-tunable-execstack.c new file mode 100644 index 0000000000..50e4fa5299 --- /dev/null +++ b/sysdeps/unix/sysv/linux/tst-execstack-tunable-execstack.c @@ -0,0 +1 @@ +#include "tst-execstack-tunable-skeleton.c" diff --git a/sysdeps/unix/sysv/linux/tst-execstack-tunable-skeleton.c b/sysdeps/unix/sysv/linux/tst-execstack-tunable-skeleton.c new file mode 100644 index 0000000000..e91f85edb7 --- /dev/null +++ b/sysdeps/unix/sysv/linux/tst-execstack-tunable-skeleton.c @@ -0,0 +1,39 @@ +/* Check glibc.rtld.execstack=2 makes the stack executable. + + Copyright (C) 2025 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include + +#include +#include + +static int +do_test (void) +{ + void *h = dlopen ("tst-execstack-mod.so", RTLD_LAZY); + TEST_VERIFY (h != NULL); + + void (*f)(void) = xdlsym (h, "tryme"); + f (); + + return 0; +} + +#include diff --git a/sysdeps/unix/sysv/linux/tst-execstack-tunable.c b/sysdeps/unix/sysv/linux/tst-execstack-tunable.c new file mode 100644 index 0000000000..50e4fa5299 --- /dev/null +++ b/sysdeps/unix/sysv/linux/tst-execstack-tunable.c @@ -0,0 +1 @@ +#include "tst-execstack-tunable-skeleton.c"