Vadim Zhukov <persg...@gmail.com> wrote:

> 2018-05-01 21:53 GMT+03:00 Theo de Raadt <dera...@openbsd.org>:
> > ktrace makes the problem more clear:
> > 
> >  25908 ps       CALL  
> > sysctl(1.55.75675.1<kern.procargs.75675.1>,0xed0cc780000,0x7f7ffffcd3d8,0,0)
> >  25908 ps       RET   sysctl -1 errno 14 Bad address
> 
> And that's it, thanks!
> 
> Now little ps(1) is happy. But now there's a question, about
> kvm_getargv() and kvm_getenv(): what behaviour do we want?
> 
>   a) They use same space, overwriting each other results (this is what
>      happens now, and noone complains).
>
>   b) Their working space should be independent of each other. This
>      isn't hard, just splitting kd->argbuf into kd->argbuf and
>      kd->envbuf. Seems a bit saner.
>
> I'm fine with any direction. The patch below implements (a), since
> it's less patching. Is it okay, or should it be (b)?

I think (b) would be the better solution, this seems very fragile.

Todd and Guenther -- what do you think?

Reply via email to