o Make kqueue's filt_procattach() function use the error value returned
by p_can(...P_CAN_SEE), rather than returning EACCES directly. This brings the error code used here into line with similar arrangements elsewhere, and prevents the leakage of pid usage information. Reviewed by: jlemon Obtained from: TrustedBSD Project
This commit is contained in:
parent
d34f8d3030
commit
e386f9bda3
@ -165,12 +165,13 @@ static int
|
||||
filt_procattach(struct knote *kn)
|
||||
{
|
||||
struct proc *p;
|
||||
int error;
|
||||
|
||||
p = pfind(kn->kn_id);
|
||||
if (p == NULL)
|
||||
return (ESRCH);
|
||||
if (p_can(curproc, p, P_CAN_SEE, NULL))
|
||||
return (EACCES);
|
||||
if ((error = p_can(curproc, p, P_CAN_SEE, NULL)))
|
||||
return (error);
|
||||
|
||||
kn->kn_ptr.p_proc = p;
|
||||
kn->kn_flags |= EV_CLEAR; /* automatically set */
|
||||
|
Loading…
Reference in New Issue
Block a user