Skip to content

Commit 4fae235

Browse files
committed
freebsd,linux,sunos: make stack non-executable
Link with -z,noexecstack to make stack memory non-executable. Makes shellcode injection through buffer overflows more difficult. Fixes: nodejs/node-v0.x-archive#7542 PR-URL: node-forward/node#8 Reviewed-By: Trevor Norris <trevnorris@gmail.com>
1 parent 6d2ac2b commit 4fae235

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

node.gyp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,12 @@
365365
'PLATFORM="sunos"',
366366
],
367367
}],
368+
[ 'OS=="freebsd" or OS=="linux"', {
369+
'ldflags': [ '-Wl,-z,noexecstack' ],
370+
}],
371+
[ 'OS=="sunos"', {
372+
'ldflags': [ '-Wl,-M,/usr/lib/ld/map.noexstk' ],
373+
}],
368374
[
369375
'OS in "linux freebsd" and node_shared_v8=="false"', {
370376
'ldflags': [

0 commit comments

Comments
 (0)