-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: shared library should have noexecstack set #17933
Comments
Looks like Windows provides it by default (starting with Windows XP and Windows Server 2003) For AIX, it provides a system level Stack Execution Disable(SED) feature: MacOSX also turns on the NX bit by default: So, maybe we just need to explicitly use |
I wonder if this is of value to @nodejs/embedders and, if so, if maybe one of them might be up for tackling it. 😄 |
As this is still open - and I am the new guy on the block: re: AIX - since POWER4 (roughly 2001) the POWER platform (and AIX) has provided SED (stack execution disable) - regardless of anything done by the compiler or linker. However, the default was, and is - to only provide the ability, not enforce it by default.
This means programs and shared-libraries may _select_ively active SED.
In this example - since both the executable and the library are in "system" mode, and the system is select, SED is not enforced - as it was not selected. After the following (as root or RBAC enabled)
Python - and I assume all the libraries that are used - are SED enabled. Note: What is general practice?
IMHO: as far as build is concerned - gcc has, and recent XLC compilers has support for a compile option (that may do something regardless of AIX SED settings) none are required. The checks can (and, imho, should) be performed by the processor. Hope this helps (more than a link to documentation that can 'move')! Michael |
What's the current availability of expert time & guidance to help resolve this? |
Based on guidance at https://wiki.ubuntu.com/SecurityTeam/Roadmap/ExecutableStacks and https://wiki.gentoo.org/wiki/Hardened/GNU_stack_quickstart, it's worth adding a Applying that guidance might not completely resolve this issue, but should contribute towards it. Does anyone have time to write or review that change? (if only review time's available, then I can prepare and push a relevant commit) |
This indicates to GNU binutils that it can unset the executable stack flag on the binary that it is building. PR-URL: #37688 Refs: #17933 Reviewed-By: Daniel Bevenius <[email protected]>
This indicates to GNU binutils that it can unset the executable stack flag on the binary that it is building. PR-URL: #37688 Refs: #17933 Reviewed-By: Daniel Bevenius <[email protected]>
While @progbits is preferred for most architectures, there are some (notably 32-bit ARM) for which it does not. %progbits is effective everywhere. See https://bugzilla.redhat.com/show_bug.cgi?id=1950528 for more details. Related: #17933 Related: #37688 Signed-off-by: Stephen Gallagher <[email protected]> PR-URL: #38312 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
While @progbits is preferred for most architectures, there are some (notably 32-bit ARM) for which it does not. %progbits is effective everywhere. See https://bugzilla.redhat.com/show_bug.cgi?id=1950528 for more details. Related: #17933 Related: #37688 Signed-off-by: Stephen Gallagher <[email protected]> PR-URL: #38312 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
This indicates to GNU binutils that it can unset the executable stack flag on the binary that it is building. PR-URL: #37688 Refs: #17933 Reviewed-By: Daniel Bevenius <[email protected]>
While @progbits is preferred for most architectures, there are some (notably 32-bit ARM) for which it does not. %progbits is effective everywhere. See https://bugzilla.redhat.com/show_bug.cgi?id=1950528 for more details. Related: #17933 Related: #37688 Signed-off-by: Stephen Gallagher <[email protected]> PR-URL: #38312 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
While @progbits is preferred for most architectures, there are some (notably 32-bit ARM) for which it does not. %progbits is effective everywhere. See https://bugzilla.redhat.com/show_bug.cgi?id=1950528 for more details. Related: #17933 Related: #37688 Signed-off-by: Stephen Gallagher <[email protected]> PR-URL: #38312 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
While @progbits is preferred for most architectures, there are some (notably 32-bit ARM) for which it does not. %progbits is effective everywhere. See https://bugzilla.redhat.com/show_bug.cgi?id=1950528 for more details. Related: #17933 Related: #37688 Signed-off-by: Stephen Gallagher <[email protected]> PR-URL: #38312 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
While @progbits is preferred for most architectures, there are some (notably 32-bit ARM) for which it does not. %progbits is effective everywhere. See https://bugzilla.redhat.com/show_bug.cgi?id=1950528 for more details. Related: #17933 Related: #37688 Signed-off-by: Stephen Gallagher <[email protected]> PR-URL: #38312 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
I believe this was fixed in 90008f8? Closing, but please reopen if I'm mistaken. |
While @progbits is preferred for most architectures, there are some (notably 32-bit ARM) for which it does not. %progbits is effective everywhere. See https://bugzilla.redhat.com/show_bug.cgi?id=1950528 for more details. Related: nodejs/node#17933 Related: nodejs/node#37688 Signed-off-by: Stephen Gallagher <[email protected]>
A non-executable stack prevents certain classes of security vulnerabilities.
-Wl,-z,noexecstack
is set when building a binary but not when building a shared library (node_shared=="true"
, corresponding to./configure --shared
.)Since the execstack bit is transitive, any binary linking to a shared library with an executable stack also ends up with an executable stack.
The practical impact is probably low because
noexecstack
is the default on many systems but it would be good to:Be explicit for consistency across platforms and toolchains, and
Have a test that checks
noexecstack
is set on the build product. It could check the output ofexecstack -q filename
but that might be Linux-only.The text was updated successfully, but these errors were encountered: