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

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



commit edf9509e4d2b0f15bea591735f3fc7226bb8ed5d
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Thu Mar 27 15:06:53 2025 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Mar 27 15:06:53 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 12a12ee781..7a502afa6b 100644
--- a/xen/arch/arm/domctl.c
+++ b/xen/arch/arm/domctl.c
@@ -172,8 +172,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.19



 


Rackspace

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