Page MenuHomeFreeBSD

Capsicumize addr2line(1).
ClosedPublic

Authored by markj on Jul 29 2019, 7:27 PM.
Tags
None
Referenced Files
F81989811: D21104.id60254.diff
Wed, Apr 24, 5:47 AM
F81989803: D21104.id60247.diff
Wed, Apr 24, 5:47 AM
Unknown Object (File)
Sat, Apr 13, 3:06 AM
Unknown Object (File)
Feb 14 2024, 4:14 AM
Unknown Object (File)
Feb 14 2024, 2:24 AM
Unknown Object (File)
Jan 15 2024, 11:29 PM
Unknown Object (File)
Dec 31 2023, 7:46 PM
Unknown Object (File)
Dec 20 2023, 3:27 AM

Details

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
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