On Sat, Sep 17, 2016 at 09:20:31PM +0200, Theo Buehler wrote:
> While this patch avoids the bug, it isn't quite right: pstat -ft should
> be equivalent to "pstat -f && pstat -t" but...
>
> $ pstat -ft
> pstat: kvm_openfiles: /dev/mem: Permission denied
>
> The actual problem is in ttymode(): if k
While this patch avoids the bug, it isn't quite right: pstat -ft should
be equivalent to "pstat -f && pstat -t" but...
$ pstat -ft
pstat: kvm_openfiles: /dev/mem: Permission denied
The actual problem is in ttymode(): if kd != NULL (which is the case if
-f is combined with -t), there are accesses
ttymode() needs nlist, otherwise "pstat -tf" will fail since kd will not be
NULL and the calls from ttymode() to KGET will error as follows:
pstat: cannot read ntty: invalid address (0)
pstat: cannot read tty_head: invalid address (0)
KGET(TTY_NTTY, ntty) and KGET(TTY_TTYLIST, tty_head) both resu