diff options
| author | cinap_lenrek <cinap_lenrek@felloff.net> | 2019-09-08 19:02:01 +0200 |
|---|---|---|
| committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2019-09-08 19:02:01 +0200 |
| commit | 62eec43340340fa981340e4b521908b40b84b782 (patch) | |
| tree | a1139b52ca33fd09c4d632ab3f39756ef1da650e | |
| parent | 6ad06b36b2a61ce20cb6a6e4c5fd15ec8ac142f8 (diff) | |
| download | plan9front-62eec43340340fa981340e4b521908b40b84b782.tar.xz | |
kernel: clear FPillegal in pexit() and before pprint()
pexit() and pprint() can get called outside of a syscall
(from procctl()) with a process that is in active note
handling and require floating point in the kernel on amd64
for aesni (devtls).
| -rw-r--r-- | sys/src/9/pc64/trap.c | 5 | ||||
| -rw-r--r-- | sys/src/9/port/proc.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/sys/src/9/pc64/trap.c b/sys/src/9/pc64/trap.c index 0f6eed294..7fc8b55fa 100644 --- a/sys/src/9/pc64/trap.c +++ b/sys/src/9/pc64/trap.c @@ -877,8 +877,10 @@ notify(Ureg* ureg) if(n->flag!=NUser && (up->notified || up->notify==0)){ qunlock(&up->debug); - if(n->flag == NDebug) + if(n->flag == NDebug){ + up->fpstate &= ~FPillegal; pprint("suicide: %s\n", n->msg); + } pexit(n->msg, n->flag!=NDebug); } @@ -901,6 +903,7 @@ if(0) print("%s %lud: notify %#p %#p %#p %s\n", if(!okaddr((uintptr)up->notify, 1, 0) || !okaddr(sp-ERRMAX-4*BY2WD, sizeof(Ureg)+ERRMAX+4*BY2WD, 1)){ qunlock(&up->debug); + up->fpstate &= ~FPillegal; pprint("suicide: bad address in notify\n"); pexit("Suicide", 0); } diff --git a/sys/src/9/port/proc.c b/sys/src/9/port/proc.c index 33166ce39..adc085db2 100644 --- a/sys/src/9/port/proc.c +++ b/sys/src/9/port/proc.c @@ -1094,6 +1094,7 @@ pexit(char *exitstr, int freemem) Chan *dot; void (*pt)(Proc*, int, vlong); + up->fpstate &= ~FPillegal; up->alarm = 0; timerdel(up); pt = proctrace; @@ -1466,6 +1467,7 @@ procctl(void) switch(up->procctl) { case Proc_exitbig: spllo(); + up->fpstate &= ~FPillegal; pprint("Killed: Insufficient physical memory\n"); pexit("Killed: Insufficient physical memory", 1); |
