News for hackers. Stuff that matters.
Re:The dissection of a simple “hello world” ELF file by bgilroy26 on Saturday November 28, 2015 @03:46PM (#10642360)
The last sentence of the first paragraph really struck me

>In general, no single section has both write and execute permissions as this could compromise the security of the system.

Re:The dissection of a simple “hello world” ELF file by 0xdada on Saturday November 28, 2015 @03:47PM (#10642366)
You can read more about it here: https://en.wikipedia.org/wiki/W%5EX
Re:The dissection of a simple “hello world” ELF file by bgilroy26 on Saturday November 28, 2015 @10:12PM (#10643571)
Thank you!
Re:The dissection of a simple “hello world” ELF file by ant6n on Saturday November 28, 2015 @03:58PM (#10642399)
Is that actually enforced in modern linux kernels? I thought it would be possible to call

    mmap(..., PROT_READ | PROT_WRITE | PROT_EXEC, ...)
Re:The dissection of a simple “hello world” ELF file by ant6n on Saturday November 28, 2015 @04:50PM (#10642589)
If this ever gets enforced it could be annoying for software that generates code at runtime, which may require quick access to some run-time data for particular instructions. It may be useful to force huge pages for dynamically generated code to improve pressure on the TLB. It can slow down code generation if the pages with code in it have to be converted to write and then converted back to execute every time a new bit of dynamic code gets added. Additionally, if the generated code instructions require access to a bit of dynamic data, it may not be able to actually reach a separate data page using immediate offsets to pc on some architectures (e.g. ARM).
Re:The dissection of a simple “hello world” ELF file by Hydraulix989 on Saturday November 28, 2015 @09:18PM (#10643459)
OpenBSD kernel enforces it (even inside the kernel, not just user mode processes):

http://marc.info/?l=openbsd-tech&m=142120787308107&w=2

Re:The dissection of a simple “hello world” ELF file by bgilroy26 on Saturday November 28, 2015 @10:11PM (#10643570)
Mike Larkin re:W^X a few days ago:

https://youtu.be/A7vtAAeW6zo