Page MenuHomeFreeBSD

Capsicumize addr2line(1).
ClosedPublic

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

Details

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

contrib/elftoolchain/addr2line/addr2line.c
719 ↗(On Diff #60242)

caph_enter.
You not using casper here.

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 marked 2 inline comments as done.
  • Include Makefile updates.
  • Address feedback.
usr.bin/addr2line/Makefile
15 ↗(On Diff #60247)

Not using casper.

usr.bin/addr2line/Makefile
15 ↗(On Diff #60247)

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

markj marked an inline comment as done.

Don't need to define WITH_CASPER.

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?

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.

In file included from /usr/src/contrib/elftoolchain/addr2line/addr2line.c:30:
/usr/include/capsicum_helpers.h:42:10: fatal error: 'libcasper.h' file not found
#include <libcasper.h>

^~~~~~~~~~~~~

1 error generated.

  • addr2line.o ---
  • [addr2line.o] Error code 1

make[3]: stopped in /usr/src/usr.bin/addr2line
1 error

make[3]: stopped in /usr/src/usr.bin/addr2line

  • cross-tools ---
  • [cross-tools] Error code 2

make[2]: stopped in /usr/src
1 error

make[2]: stopped in /usr/src