elf.h "Linux extensions" disagree with Linux
Isaac Dunham <[email protected]> Sun, 20 Jul 2014 08:29:37 -0700
| Newsgroups | gmane.os.dragonfly-bsd.kernel |
|---|---|
| Message-ID | <20140720152932.GB3861@newbook> |
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