Page MenuHomeFreeBSD

Capsicumize strings
ClosedPublic

Authored by oshogbo on Nov 18 2018, 3:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 4 2024, 3:07 AM
Unknown Object (File)
Oct 23 2024, 11:49 AM
Unknown Object (File)
Sep 28 2024, 2:18 AM
Unknown Object (File)
Sep 28 2024, 2:18 AM
Unknown Object (File)
Sep 28 2024, 2:18 AM
Unknown Object (File)
Sep 28 2024, 2:18 AM
Unknown Object (File)
Sep 28 2024, 2:18 AM
Unknown Object (File)
Sep 28 2024, 2:05 AM

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

cem added inline comments.
contrib/elftoolchain/strings/strings.c
200

I would maybe print "unable to initialize casper fileargs."

I expect emaste will say, "what do we expect a user to do differently?", and from that perspective, sure, the two failures are essentially the same problem. But as a developer who may occasionally debug capsicumized programs, I greatly prefer that error messages are unique in code, so it is clear where the fault occurred.

I do not feel strongly about it.

204

Why free before err() exit?

220

Why free before return exit? :-)

usr.bin/strings/Makefile
13–17

If !defined(WITH_CASPER), does caph_enter_casper() not enter the capsicum sandbox?

(It seems that this program will be totally broken if the sandbox is entered with MK_CASPER=no.)

This revision is now accepted and ready to land.Nov 18 2018, 11:38 PM

As with the other strings reviews, adding @kaiw and @jkoshy_users.sourceforge.net to CC

I think we want to rework this change slightly so that it could be changed upstream and still buid out of the box on Linux and older FreeBSD.

contrib/elftoolchain/strings/strings.c
200

That is what I might say, but I don't feel strongly either.

contrib/elftoolchain/strings/strings.c
202–203

@jkoshy_users.sourceforge.net this is the "sandbox setup & enter" entry; for OpenBSD this would be a pledge() call.

The fileargs_init() and fileargs_fopen() are the magic bits that perform the privilege separated file opening and fd shuffling that do not have an equivalent on !FreeBSD.

Adding @arichardson for comment on Linux bootstrapping.

contrib/elftoolchain/strings/strings.c
200

Ok I will address that.

204

It's just nice to clean up after yourself, and I wanted to do another good example just to fallow.

220

It's just nice to clean up after yourself, and I wanted to do another good example just to fallow.

usr.bin/strings/Makefile
13–17

Yes.

This revision was automatically updated to reflect the committed changes.
reg added a subscriber: reg.

Fails with WITHOUT_CAPSICUM...

In D18038#446790, @reg wrote:

Fails with WITHOUT_CAPSICUM...

Please submit a PR with the build failure

head/contrib/elftoolchain/strings/strings.c
203 ↗(On Diff #55805)

This should be ||.

This revision is now accepted and ready to land.Jul 29 2019, 9:55 PM