Re: pledge(2): prof promise

2017-04-20 Thread Sebastien Marie
On Thu, Apr 20, 2017 at 12:08:02PM +0200, Sebastien Marie wrote: > > profil(2) syscall itself could be allowed in "stdio" with specifics > arguments: profil(NULL, 0, 0, 0) (but some code inspection should be > done before: extending "stdio" is not neutral - think to programs like > ssh or tcpdump

Re: pledge(2): prof promise

2017-04-20 Thread Sebastien Marie
On Thu, Apr 20, 2017 at 03:34:57AM -0600, Theo de Raadt wrote: > This proposal doesn't make any sense. > > What will you do. Add it to every program? Or add it to none of them? hep. it is a part of the problem I spotted :) > The underlying problem is that the syscall creates a file in some >

Re: pledge(2): prof promise

2017-04-20 Thread Theo de Raadt
This proposal doesn't make any sense. What will you do. Add it to every program? Or add it to none of them? The underlying problem is that the syscall creates a file in some random place. You haven't handled that. > On Thu, Apr 20, 2017 at 09:52:58AM +0200, Sebastien Marie wrote: > > Could

Re: pledge(2): prof promise

2017-04-20 Thread Anton Lindqvist
On Thu, Apr 20, 2017 at 09:52:58AM +0200, Sebastien Marie wrote: > Could you send two separated diffs ? One for uint64_t stuff and another > for profil(2) ? Here's the prof diff. Thanks for the feedback, I will review it more closely later today. Index: lib/libc/sys/pledge.2

Re: pledge(2): prof promise

2017-04-20 Thread Anton Lindqvist
On Thu, Apr 20, 2017 at 09:52:58AM +0200, Sebastien Marie wrote: > Could you send two separated diffs ? One for uint64_t stuff and another > for profil(2) ? Coming up, first off the uint64_t diff. While at it, I propose changing the type of code in `struct ktr_pledge` to uint64_t for consistency

Re: pledge(2): prof promise

2017-04-20 Thread Sebastien Marie
Hi, Could you send two separated diffs ? One for uint64_t stuff and another for profil(2) ? I agree that uint64_t change is required, but I need to deeper check the stuff for profil(2) :) For now, my initial feeling is adding a promise for profiling requires to patch the source code to be able

pledge(2): prof promise

2017-04-20 Thread Anton Lindqvist
Hi, Profiling a pledged program using gprof(1) is not possible since the profil(2) syscall is not allowed. I have previously temporally removed the pledge-calls as a work-around. But I thought it would be an exercise worthwhile to try implementing a new pledge promise. In addition to allowing