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

[xen stable-4.18] Arm/domctl: correct XEN_DOMCTL_vuart_op error return value



commit d2257148a7c940c4836afdaece66c566fb416a9b
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Thu Mar 27 15:27:09 2025 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Mar 27 15:27:09 2025 +0100

    Arm/domctl: correct XEN_DOMCTL_vuart_op error return value
    
    copy_to_guest() returns the number of bytes not copied; that's not what
    the function should return to its caller though. Convert to returning
    -EFAULT instead.
    
    Fixes: 86039f2e8c20 ("xen/arm: vpl011: Add a new domctl API to initialize 
vpl011")
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: Michal Orzel <michal.orzel@xxxxxxx>
    master commit: 341c0df40bf73b0a5e27db27023ec400858a472d
    master date: 2025-03-27 12:22:39 +0100
---
 xen/arch/arm/domctl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domctl.c b/xen/arch/arm/domctl.c
index ad56efb0f5..8e9851e560 100644
--- a/xen/arch/arm/domctl.c
+++ b/xen/arch/arm/domctl.c
@@ -171,8 +171,8 @@ long arch_do_domctl(struct xen_domctl *domctl, struct 
domain *d,
             break;
         }
 
-        if ( !rc )
-            rc = copy_to_guest(u_domctl, domctl, 1);
+        if ( !rc && copy_to_guest(u_domctl, domctl, 1) )
+            rc = -EFAULT;
 
         return rc;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.18



 


Rackspace

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