mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-29 03:45:02 +01:00
hwpmc: On attach, fix allowing a PMC's owner to attach it to itself
The returned value in this case was wrong, and would basically prevent
some PMC's owner process to attach that PMC to itself although the
security checks underneath would have allowed it.
Now that this early return has been fixed, its block basically becomes
a performance short-circuit which has no effect from a functional
standpoint.
Fixes: ebccf1e3a6 ("Bring a working snapshot of hwpmc(4), ...")
MFC after: 9 days
Sponsored by: The FreeBSD Foundation
This commit is contained in:
1 file changed
+1
-1
@@ -1041,7 +1041,7 @@ pmc_can_attach(struct pmc *pm, struct proc *t)
|
||||
*/
|
||||
|
||||
if ((o = pm->pm_owner->po_owner) == t)
|
||||
return (false);
|
||||
return (true);
|
||||
|
||||
PROC_LOCK(o);
|
||||
oc = o->p_ucred;
|
||||
|
||||
Reference in new issue
Block a user