Page MenuHomeFreeBSD

Capsicumize addr2line(1).
ClosedPublic

Authored by markj on Jul 29 2019, 7:27 PM.
Tags
None
Referenced Files
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
Unknown Object (File)
Dec 10 2023, 12:08 PM
Unknown Object (File)
Nov 17 2023, 12:07 PM
Unknown Object (File)
Nov 12 2023, 6:50 AM

Details

Diff Detail

Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 25577
Build 24181: arc lint + arc unit

Event Timeline

contrib/elftoolchain/addr2line/addr2line.c
719

caph_enter.
You not using casper here.

contrib/elftoolchain/addr2line/addr2line.c
713

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

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

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