Page MenuHomeFreeBSD

Capsicumize addr2line(1).
ClosedPublic

Authored by markj on Jul 29 2019, 7:27 PM.

Details

Diff Detail

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

Event Timeline

markj created this revision.Jul 29 2019, 7:27 PM
oshogbo added inline comments.Jul 29 2019, 7:34 PM
contrib/elftoolchain/addr2line/addr2line.c
719 ↗(On Diff #60242)

caph_enter.
You not using casper here.

oshogbo added inline comments.Jul 29 2019, 7:35 PM
contrib/elftoolchain/addr2line/addr2line.c
713 ↗(On Diff #60242)

This can be a one linear:
if (caph_rights_limit(fd, cap_rights_init(&rights, CAP_FSTAT, CAP_MMAP_R)) < 0)

markj updated this revision to Diff 60247.Jul 29 2019, 7:41 PM
markj marked 2 inline comments as done.
  • Include Makefile updates.
  • Address feedback.
oshogbo added inline comments.Jul 29 2019, 8:55 PM
usr.bin/addr2line/Makefile
15 ↗(On Diff #60247)

Not using casper.

markj added inline comments.Jul 29 2019, 9:08 PM
usr.bin/addr2line/Makefile
15 ↗(On Diff #60247)

Ah, I thought this define was needed to use all caph_*

markj updated this revision to Diff 60254.Jul 29 2019, 9:10 PM
markj marked an inline comment as done.

Don't need to define WITH_CASPER.

oshogbo added inline comments.Jul 31 2019, 6:00 PM
contrib/elftoolchain/addr2line/addr2line.c
712 ↗(On Diff #60254)

IF THE ELF will be built without ELFTC_HAVE_MMAP it will require read permissions as well. Should we support that?

markj added inline comments.Jul 31 2019, 6:23 PM
contrib/elftoolchain/addr2line/addr2line.c
712 ↗(On Diff #60254)

I think this is probably overkill. _elftc.h defines ELFTC_HAVE_MMAP based on the target OS, it's not a compile-time configuration parameter. The capsicum additions are FreeBSD specific, so I think it's safe to simply assume that mmap is available.

This revision is now accepted and ready to land.Jul 31 2019, 6:26 PM
This revision was automatically updated to reflect the committed changes.