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> master commit:1ee8b11c11master date: 2026-02-06 20:56:16 +0100
This commit is contained in:
1 parent
2fd8436301
commit
60f5b47d48
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);
|
||||
|
||||