diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2013-12-29 07:48:19 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2013-12-29 07:48:19 +0100 |
commit | 42074003ca31dea9589012fe3e235e4ddec5be1f (patch) | |
tree | 853027cfd12f6cad1f310de95927455d71101656 /sys/src/9/omap | |
parent | afc2d547e18381ce2dd0f69f0e88860d49b7e54f (diff) |
kernel: dont call pprint() while holding up->debug qlock
pprint() might block or even (maliciously) call into
devproc write which will corrupt the qlock chain on attempt
to qlock up->debug again.
Diffstat (limited to 'sys/src/9/omap')
-rw-r--r-- | sys/src/9/omap/syscall.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sys/src/9/omap/syscall.c b/sys/src/9/omap/syscall.c index e40a82174..378a08a21 100644 --- a/sys/src/9/omap/syscall.c +++ b/sys/src/9/omap/syscall.c @@ -80,16 +80,12 @@ noted(Ureg* cur, uintptr arg0) cur->sp = PTR2UINT(nf); break; default: - pprint("unknown noted arg %#p\n", arg0); up->lastnote.flag = NDebug; /*FALLTHROUGH*/ case NDFLT: - if(up->lastnote.flag == NDebug){ - qunlock(&up->debug); + qunlock(&up->debug); + if(up->lastnote.flag == NDebug) pprint("suicide: %s\n", up->lastnote.msg); - } - else - qunlock(&up->debug); pexit(up->lastnote.msg, up->lastnote.flag != NDebug); } } @@ -127,9 +123,9 @@ notify(Ureg* ureg) } if(n->flag != NUser && (up->notified || up->notify == 0)){ + qunlock(&up->debug); if(n->flag == NDebug) pprint("suicide: %s\n", n->msg); - qunlock(&up->debug); pexit(n->msg, n->flag != NDebug); } @@ -144,8 +140,8 @@ notify(Ureg* ureg) pexit(n->msg, n->flag != NDebug); } if(!okaddr(PTR2UINT(up->notify), 1, 0)){ - pprint("suicide: notify function address %#p\n", up->notify); qunlock(&up->debug); + pprint("suicide: notify function address %#p\n", up->notify); pexit("Suicide", 0); } |