Page MenuHomeFreeBSD

Capsicumize strings
ClosedPublic

Authored by oshogbo on Nov 18 2018, 3:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 14 2024, 8:48 AM
Unknown Object (File)
Dec 24 2023, 12:31 PM
Unknown Object (File)
Dec 24 2023, 12:31 PM
Unknown Object (File)
Dec 20 2023, 2:08 AM
Unknown Object (File)
Dec 11 2023, 1:41 AM
Unknown Object (File)
Nov 11 2023, 1:46 AM
Unknown Object (File)
Nov 10 2023, 7:40 AM
Unknown Object (File)
Nov 8 2023, 7:40 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?

218

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.

218

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