diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2019-08-27 03:47:18 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2019-08-27 03:47:18 +0200 |
commit | 2149600d129944f60cbc858bc669193af0523409 (patch) | |
tree | 89cd2d2b36e204bbb50ed2159ebdbf7f2cd7e01c /sys/src/9/xen | |
parent | 128ea44a89c7905612ad2fa5a61a9325ddfb5e1e (diff) |
kernel: catch execution read fault on SG_NOEXEC segment
fault() now has an additional pc argument that is
used to detect fault on a non-executable segment.
that is, we check on read fault if the segment
has the SG_NOEXEC attribute and the program counter
is within faulting page.
Diffstat (limited to 'sys/src/9/xen')
-rw-r--r-- | sys/src/9/xen/trap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/src/9/xen/trap.c b/sys/src/9/xen/trap.c index 1ab080c60..e8e401585 100644 --- a/sys/src/9/xen/trap.c +++ b/sys/src/9/xen/trap.c @@ -598,7 +598,7 @@ unexpected(Ureg* ureg, void*) } static void -fault386(Ureg* ureg, void* ) +fault386(Ureg* ureg, void*) { ulong addr; int read, user, n, insyscall; @@ -621,7 +621,7 @@ fault386(Ureg* ureg, void* ) panic("fault but up is zero; pc 0x%8.8lux addr 0x%8.8lux\n", ureg->pc, addr); insyscall = up->insyscall; up->insyscall = 1; - n = fault(addr, read); + n = fault(addr, ureg->pc, read); if(n < 0){ if(!user){ dumpregs(ureg); |