mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
xen/kexec: return error code for unknown hypercalls
Currently do_kexec_op_internal() will return 0 for unknown hypercalls. Fix
this by returning -EOPNOTSUPP instead.
While there remove the pointless initialization of ret to -EINVAL; it just
makes the code confusing.
Fixes: d046f361dc ("Xen Security Modules: XSM")
Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
1 parent
381b4ff16f
commit
1ee8b11c11
1 file changed
+5
-1
+5
-1
@@ -1217,7 +1217,7 @@ static int do_kexec_op_internal(unsigned long op,
|
||||
XEN_GUEST_HANDLE_PARAM(void) uarg,
|
||||
bool compat)
|
||||
{
|
||||
int ret = -EINVAL;
|
||||
int ret;
|
||||
|
||||
ret = xsm_kexec(XSM_PRIV);
|
||||
if ( ret )
|
||||
@@ -1258,6 +1258,10 @@ static int do_kexec_op_internal(unsigned long op,
|
||||
case KEXEC_CMD_kexec_status:
|
||||
ret = kexec_status(uarg);
|
||||
break;
|
||||
|
||||
default:
|
||||
ret = -EOPNOTSUPP;
|
||||
break;
|
||||
}
|
||||
|
||||
clear_bit(KEXEC_FLAG_IN_HYPERCALL, &kexec_flags);
|
||||
|
||||