execstack(8)
π execstack(8) β System Manager's Manual π
πΈ NAME πΈ
execstack β tool to set, clear, or query executable stack flag of ELF binaries and shared libraries.
β¨ SYNOPSIS β¨
execstack [OPTION...] [FILES]
π¦ DESCRIPTION π¦
okay so bestie, execstack is a program which sets, clears, or queries executable stack flag of ELF binaries and shared libraries. π
Linux has in the past allowed execution of instructions on the stack and there are lots of binaries and shared libraries assuming this behaviour. π furthermore, GCC trampoline code for e.g. nested functions requires executable stack on many architectures. π«
to avoid breaking binaries and shared libraries which need executable stack, ELF binaries and shared libraries now can be marked as requiring executable stack or not requiring it. β¨ the way that this marking is done is through the p_flags field in the PT_GNU_STACK program header entry. if the marking is missing, kernel or dynamic linker need to assume it might need executable stack. π
the marking is done automatically by recent GCC versions (objects using trampolines on the stack are marked as requiring executable stack, all other newly built objects are marked as not requiring it) and linker collects these markings into marking of the whole binary or shared library. π the user can override this at assembly time (through --execstack or --noexecstack assembler options), at link time (through -z execstack or -z noexecstack linker options) and using the execstack tool also on an already linker binary or shared library. π this tool is especially useful for third party shared libraries where it is known that they don't need executable stack or testing proves it. π₯
π OPTIONS π
-s,--set-execstackβ mark binary or shared library as requiring executable stack. slay.-c,--clear-execstackβ mark binary or shared library as not requiring executable stack. no cap.-q,--queryβ query executable stack marking of binaries and shared libraries. for each file it prints either-when executable stack is not required,Xwhen executable stack is required or?when it is unknown whether the object requires or doesn't require executable stack (the marking is missing). π-Vβ printexecstackversion and exit. periodt.-?,--helpβ print help message. π«Ά--usageβ print a short usage message. β¨
π ARGUMENTS π
command line arguments should be names of ELF binaries and shared libraries which should be modified or queried. π
π EXAMPLES π
# execstack -s ~/lib/libfoo.so.1
will mark ~/lib/libfoo.so.1 as requiring executable stack. π
# execstack -c ~/bin/bar
will mark ~/bin/bar as not requiring executable stack. β¨
# execstack -q ~/lib/libfoo.so.1 ~/bin/bar
will query executable stack marking of the given files. π
π SEE ALSO π
ld.so(8). obsessed.
π BUGS π
execstack doesn't support yet marking of executables if they do not have PT_GNU_STACK program header entry nor they have room for program segment header table growth. π
π AUTHORS π
Jakub Jelinek <jakub@redhat.com>.
that's the wholeexecstack(8)manual page, bestie β source/version isexecstack(8), dated 28 October 2003 πβ¨
π¦ where this page comes from
- centos-stream 10: execstack 0.5.0-31.el10 Β· GPL-2.0-or-later
- centos-stream 9: execstack 0.5.0-23.el9 Β· GPLv2+
- fedora 43: execstack 0.5.0-31.fc43 Β· GPL-2.0-or-later
- fedora 44: execstack 0.5.0-32.fc44 Β· GPL-2.0-or-later
- nixos 26.05: prelink 20151030-unstable-2024-07-02
- nixpkgs unstable: prelink 20151030-unstable-2024-07-02
- opensuse-leap 16.0: execstack 0.5.0-bp160.1.12 Β· GPL-2.0-or-later
- opensuse-leap 16.0: execstack 0.5.0-bp160.1.12 Β· GPL-2.0-or-later
- opensuse-leap 16.0: execstack 0.5.0-bp160.1.12 Β· GPL-2.0-or-later
- opensuse-leap 16.0: execstack 0.5.0-bp160.1.12 Β· GPL-2.0-or-later
- ubuntu jammy: execstack 0.0.20131005-1.1 Β· GPL-2.0-or-later
- ubuntu noble: execstack 0.0.20131005-1.1ubuntu1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms