elf.h "Linux extensions" disagree with Linux

Isaac Dunham ibid.ag at gmail.com
Sun Jul 20 08:29:37 PDT 2014


Hello,
I'm mainly a Linux guy, but I've been interested in DragonFlyBSD for a while.
Recently, an OpenBSD/LibreSSL developer contributed an issetugid()
implementation to musl libc, motivated by the potential for 
	getauxval(AT_SECURE);
to return 0 if AT_SECURE is not supported.
This can cause security holes with some Linux applications.
On Linux, this happens only on pre-2.6 kernels.
So I looked at the DragonFly Linux emulation layer to see if it supported
AT_SECURE.
I discovered that AT_SECURE was not implemented and that all the AT_* values
in sys/cpu/*/include/elf.h greater than 14 bore no relationship to those
on Linux, although the comments claim them to be from Linux.


I'm planning to send a patch that 
(1) puts AT_EXECPATH and AT_OSRELDATE in a separate section of elf.h
(since they aren't Linux values),
(2) deletes the "not implemented" section (16-17 and 19-23),
(3) replaces them with the numbers that Linux actually uses, and 
(4) implements AT_SECURE in sys/emulation/linux/i386/linux_sysvec.c;
while I'm there I might add AT_EXECFN.

Are there any problems with this?
In particular, should (1) and (2) be "move this whole block down"?

Thanks,
Isaac Dunham



More information about the Kernel mailing list