mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 09:41:03 -04:00
HBSD SEGVGUARD: Check if SEGVGUARD is active before doing any work
Simply move the check if SEGVGUARD is active to the top of the functions that utilize the check. No need to waste CPU cycles if SEGVGUARD isn't active. Signed-off-by: Shawn Webb <shawn.webb@hardenedbsd.org> MFC-to: 10-STABLE MFC-to: 11-STABLE (cherry picked from commit 94ec671827b6e75e180324424847c6210c3ffaca)
This commit is contained in:
parent
21077f2f71
commit
5abb3d76c5
1 changed files with 6 additions and 6 deletions
|
|
@ -444,15 +444,15 @@ pax_segvguard_segfault(struct thread *td, const char *name)
|
|||
struct vnode *v;
|
||||
sbintime_t sbt;
|
||||
|
||||
if (pax_segvguard_active(td->td_proc) == false)
|
||||
return (0);
|
||||
|
||||
v = td->td_proc->p_textvp;
|
||||
if (v == NULL)
|
||||
return (EFAULT);
|
||||
|
||||
pr = pax_get_prison_td(td);
|
||||
|
||||
if (pax_segvguard_active(td->td_proc) == false)
|
||||
return (0);
|
||||
|
||||
sbt = sbinuptime();
|
||||
|
||||
se = pax_segvguard_lookup(td, v);
|
||||
|
|
@ -495,12 +495,12 @@ pax_segvguard_check(struct thread *td, struct vnode *v, const char *name)
|
|||
struct pax_segvguard_entry *se;
|
||||
sbintime_t sbt;
|
||||
|
||||
if (v == NULL)
|
||||
return (EFAULT);
|
||||
|
||||
if (pax_segvguard_active(td->td_proc) == false)
|
||||
return (0);
|
||||
|
||||
if (v == NULL)
|
||||
return (EFAULT);
|
||||
|
||||
sbt = sbinuptime();
|
||||
|
||||
se = pax_segvguard_lookup(td, v);
|
||||
|
|
|
|||
Loading…
Reference in a new issue