Module: xenomai-rpm
Branch: for-upstream
Commit: eccfd28eefed1caf763b9ab39b665c4b3852d117
URL:    
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=eccfd28eefed1caf763b9ab39b665c4b3852d117

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Mar 11 11:04:14 2010 +0100

nucleus: warn about denied syscalls

---

 ksrc/nucleus/shadow.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/ksrc/nucleus/shadow.c b/ksrc/nucleus/shadow.c
index d5e5539..95995f6 100644
--- a/ksrc/nucleus/shadow.c
+++ b/ksrc/nucleus/shadow.c
@@ -2072,10 +2072,8 @@ static inline int do_hisyscall_event(unsigned event, 
unsigned domid, void *data)
         * __xn_sys_bind which does its own checks.
         */
        if (unlikely(!cap_raised(current_cap(), CAP_SYS_NICE)) &&
-           __xn_reg_mux(regs) != __xn_mux_code(0, __xn_sys_bind)) {
-               __xn_error_return(regs, -EPERM);
-               return RTHAL_EVENT_STOP;
-       }
+           __xn_reg_mux(regs) != __xn_mux_code(0, __xn_sys_bind))
+               goto no_permission;
 
        muxid = __xn_mux_id(regs);
        muxop = __xn_mux_op(regs);
@@ -2093,7 +2091,12 @@ static inline int do_hisyscall_event(unsigned event, 
unsigned domid, void *data)
 
        sysflags = muxtable[muxid].props->systab[muxop].flags;
 
-       if ((sysflags & __xn_exec_shadow) != 0 && !thread) {
+       if ((sysflags & __xn_exec_shadow) != 0 && thread == NULL) {
+       no_permission:
+               if (XENO_DEBUG(NUCLEUS))
+                       printk(KERN_WARNING
+                              "Xenomai: non-shadow %s[%d] was denied a 
real-time call\n",
+                              current->comm, current->pid);
                __xn_error_return(regs, -EPERM);
                goto ret_handled;
        }


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to