Page MenuHomeFreeBSD

elf_aux_info: Add support for AT_EXECPATH.
ClosedPublic

Authored by brooks on Nov 13 2019, 9:28 PM.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

sef added a subscriber: sef.
sef added inline comments.
lib/libc/gen/auxv.c
158 ↗(On Diff #64286)

Just a clarification on my part: kernel interfaces return EFAULT, but user returning EINVAL is correct, right?

sys/sys/param.h
63 ↗(On Diff #64286)

Is that supposed to be here?

This revision is now accepted and ready to land.Nov 13 2019, 9:32 PM
emaste added inline comments.
lib/libc/gen/auxv.c
161 ↗(On Diff #64286)

looks like other cases (incorrectly?) return ENOENT for a too-small buffer, but this seems fine

sys/sys/param.h
63 ↗(On Diff #64286)

I asked for a bump so I can put a conditional in llvm, https://reviews.llvm.org/D70198

sys/sys/param.h
63 ↗(On Diff #64286)

Ok, that makes sense.

`

lib/libc/gen/auxv.c
158 ↗(On Diff #64286)

The kernel returns EFAULT on NULL pointers because it potentially takes a fault in copyout. The AT_CANARY code above crashes which seems gratuitous.

161 ↗(On Diff #64286)

I followed the documentation here.

[EINVAL]           The provided buffer was not the right size for the
                   requested item.

Above, I considered buf=NULL to be a degenerate case of not-the-right-size.

This revision was automatically updated to reflect the committed changes.
brooks marked 2 inline comments as done.