[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] domctl: error code adjustment for unpriv callers



commit a89ca78901656c81003e61d88bc8327a57c7ce9c
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Jun 16 14:17:30 2026 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Jun 16 14:17:30 2026 +0200

    domctl: error code adjustment for unpriv callers
    
    Unprivileged callers better wouldn't be in the position of figuring out
    domain existence from error codes. Adjust the respective path sitting
    ahead of XSM checks to produce -EPERM in such cases, just like the
    subsequent XSM check would yield.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
---
 xen/common/domctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 0c11ddc2f7..61149d740e 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -358,7 +358,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) 
u_domctl)
     default:
         d = rcu_lock_domain_by_id(op->domain);
         if ( !d )
-            return -ESRCH;
+            return is_control_domain(current->domain) ? -ESRCH : -EPERM;
         break;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.