kcmp_pget(): do not accept TIDs
Otherwise pget() might still look up and hold the current process. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 3 days
This commit is contained in:
@@ -2098,7 +2098,8 @@ kcmp_pget(struct thread *td, pid_t pid, struct proc **pp)
|
||||
*pp = td->td_proc;
|
||||
return (0);
|
||||
}
|
||||
error = pget(pid, PGET_CANDEBUG | PGET_NOTWEXIT | PGET_HOLD, pp);
|
||||
error = pget(pid, PGET_NOTID | PGET_CANDEBUG | PGET_NOTWEXIT |
|
||||
PGET_HOLD, pp);
|
||||
MPASS(*pp != td->td_proc);
|
||||
return (error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user