Module: xenomai-jki
Branch: for-forge
Commit: d8b52cbbcb5ff812d399c41922be993079ceba4f
URL:    
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=d8b52cbbcb5ff812d399c41922be993079ceba4f

Author: Jan Kiszka <jan.kis...@siemens.com>
Date:   Fri Mar 10 14:04:37 2017 +0100

cobalt/syscall: Handle bogus fastcall gracefully

It's not a kernel bug when userspace issues an invalid syscall from a RT
thread.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>

---

 kernel/cobalt/posix/syscall.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/kernel/cobalt/posix/syscall.c b/kernel/cobalt/posix/syscall.c
index 25d21ea..3c85541 100644
--- a/kernel/cobalt/posix/syscall.c
+++ b/kernel/cobalt/posix/syscall.c
@@ -800,9 +800,13 @@ int ipipe_fastcall_hook(struct pt_regs *regs)
        int ret;
 
        ret = handle_head_syscall(&xnsched_realtime_domain, regs);
-       XENO_BUG_ON(COBALT, ret == KEVENT_PROPAGATE);
+       if (ret == KEVENT_PROPAGATE) {
+               printk(XENO_WARNING "bad linux syscall <%#lx>\n",
+                      __xn_syscall(regs));
+               __xn_error_return(regs, -ENOSYS);
+       }
 
-       return ret;
+       return KEVENT_STOP;
 }
 
 long cobalt_restart_syscall_placeholder(struct restart_block *param)


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

Reply via email to