From: Kees Jongenburger Date: Tue, 19 Feb 2013 12:17:54 +0000 (+0100) Subject: kernel:handle improper svc calls gracefully. X-Git-Tag: v3.3.0~1141 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=d47f512a136ee5ec672097fc3f33a47928e9b14a;p=minix.git kernel:handle improper svc calls gracefully. Change-Id: Id0f694dd2a8c5981900601fcdb2112ee266d0d76 --- diff --git a/kernel/arch/earm/mpx.S b/kernel/arch/earm/mpx.S index 96bf3f538..622bc83f9 100644 --- a/kernel/arch/earm/mpx.S +++ b/kernel/arch/earm/mpx.S @@ -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 */