Disable tracing on FreeBSD using procctl. (OpenSSH Portable 8.8)

Ed Maste emaste at freebsd.org
Sun Nov 6 11:54:35 AEDT 2022


On Sat, 5 Nov 2022 at 20:41, Darren Tucker <dtucker at dtucker.net> wrote:
>
> Thanks for following up.
>
> On Sun, 6 Nov 2022 at 05:34, Ed Maste <emaste at freebsd.org> wrote:
> [...]
> > -       if (procctl(P_PID, 0, PROC_TRACE_CTL, &disable_trace) && strict)
> > +       if (procctl(P_PID, getpid(), PROC_TRACE_CTL, &disable_trace) && strict)
>
> You seem to be making the exact opposite change in your stable branches?
> https://github.com/freebsd/freebsd-src/commit/b5b1a69
>
> Is the situation that "0" only works on fixed kernels, but "getpid()"
> works on all (albeit not optimally)?

That is correct. In the FreeBSD stable branches we know we're also
building a kernel which allows 0 instead of getpid(), but I imagine
that there are some people who will build a contemporary OpenSSH on
older FreeBSD versions.

We could add a test based on __FreeBSD_version or see if it could be
handled by autoconf, if you think it's worthwhile.


More information about the openssh-unix-dev mailing list