From: David van Moolenbroek Date: Sat, 28 Nov 2009 13:15:07 +0000 (+0000) Subject: Kernel: fix faulty trap check X-Git-Tag: v3.1.6~192 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/man.named-checkzone.html?a=commitdiff_plain;h=6c6e1db676021a3d09f6be65eedfd8a5a829d565;p=minix.git Kernel: fix faulty trap check --- diff --git a/kernel/proc.c b/kernel/proc.c index 02e2c0e48..2f1f9d15c 100644 --- a/kernel/proc.c +++ b/kernel/proc.c @@ -405,7 +405,10 @@ long bit_map; /* notification event set or flags */ return(ETRAPDENIED); /* trap denied by mask or kernel */ } - if ((iskerneln(src_dst_p) && call_nr != SENDREC && call_nr != RECEIVE)) { + /* SENDA has no src_dst value here, so this check is in mini_senda() as well. + */ + if (call_nr != SENDREC && call_nr != RECEIVE && call_nr != SENDA && + iskerneln(src_dst_p)) { #if DEBUG_ENABLE_IPC_WARNINGS kprintf("sys_call: trap %d not allowed, caller %d, src_dst %d\n", call_nr, proc_nr(caller_ptr), src_dst_e); @@ -915,6 +918,19 @@ size_t size; continue; } + if (iskerneln(dst_p)) + { + /* Asynchronous sends to the kernel are not allowed */ + tabent.result= ECALLDENIED; + A_INSERT(i, result); + tabent.flags= flags | AMF_DONE; + A_INSERT(i, flags); + + if (flags & AMF_NOTIFY) + do_notify= 1; + continue; + } + if (!may_send_to(caller_ptr, dst_p)) { /* Send denied by IPC mask */