Re: relaxing sysctl_proc_vmmap checks for debugging

2016-06-28 Thread Gabriel Kihlman
"Ted Unangst" writes: > > Thanks for reminding me to revisit this. I think the following diff is > sufficient. Still works fine for me, thanks. /gabriel > > > Index: kern_sysctl.c > === > RCS file: /cvs/src/sys/kern/kern_sysctl.

Re: relaxing sysctl_proc_vmmap checks for debugging

2016-06-28 Thread Ted Unangst
Gabriel Kihlman wrote: > -#if 1 > - /* XXX Allow only root for now */ > - if ((error = suser(cp, 0)) != 0) > + /* Only owner (unless the last exec gave it setuid/setgid > + * privs) or root can get vmmap. > + */ > + if ((fin

relaxing sysctl_proc_vmmap checks for debugging

2016-06-28 Thread Gabriel Kihlman
I wanted to get the memory map of a child proc with sysctl but noticed I could only do this as root. I am allowed to ptrace it though so it felt a bit unfair.. ..so what about doing some of the the same checks as is done upon PT_ATTACH? (and hijacking the global_ptrace global to mean we can get t