]> Zhao Yanbai Git Server - minix.git/commitdiff
kernel:handle improper svc calls gracefully. 40/340/2
authorKees Jongenburger <keesj@minix3.org>
Tue, 19 Feb 2013 12:17:54 +0000 (13:17 +0100)
committerKees Jongenburger <keesj@minix3.org>
Tue, 19 Feb 2013 16:02:29 +0000 (17:02 +0100)
Change-Id: Id0f694dd2a8c5981900601fcdb2112ee266d0d76

kernel/arch/earm/mpx.S

index 96bf3f538712edde11c57bd4d1f9892d04a6664b..622bc83f9c9313ba4bc8be86c2291a23f0f27464 100644 (file)
@@ -192,7 +192,11 @@ ENTRY(svc_entry)
        beq     kernel_call_entry
        cmp     r3, #IPCVEC
        beq     ipc_entry
-       b       invalid_svc
+
+       /* return -1 to the current process as an invalid SWI was called .*/
+       mov     r0, #-1
+       str     r0, [fp, #REG0]
+       b       _C_LABEL(switch_to_user)
 
 /*
  * kernel call is only from a process to kernel
@@ -244,7 +248,7 @@ ENTRY(ipc_entry)
        b       _C_LABEL(switch_to_user)
 
 ENTRY(invalid_svc)
-       b .
+       b       .
 
 ENTRY(restore_user_context)
        /* sp holds the proc ptr */