From: Julien Grall Date: Thu, 30 Apr 2020 10:20:44 +0000 (+0100) Subject: tools/xl: vcpu-pin: Skip global affinity when the hard affinity is not changed X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~289 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3748c81fa1ff5e67c0442978c583e722820b1690;p=xen.git tools/xl: vcpu-pin: Skip global affinity when the hard affinity is not changed After XSA-273, it is not possible to modify the vCPU soft affinity using xl vcpu-pin without modifying the hard affinity. Instead the command will crash. 42sh> gdb /usr/local/sbin/xl (gdb) r vcpu-pin 0 0 - 10 [...] Program received signal SIGSEGV, Segmentation fault. [...] (gdb) bt This is happening because 'xl' will use NULL when an affinity doesn't need to be modified. However, we will still try to apply the global affinity in the this case. As the hard affinity is not changed, then we don't need to apply the global affinity. So skip it when hard is NULL. Backport: 4.6+ # Any release with XSA-273 Fixes: aa67b97ed342 ("xl.conf: Add global affinity masks") Reported-by: Pawel Wieczorkiewicz Signed-off-by: Julien Grall Acked-by: Wei Liu --- diff --git a/tools/xl/xl_vcpu.c b/tools/xl/xl_vcpu.c index 9ff5354f74..66877a57de 100644 --- a/tools/xl/xl_vcpu.c +++ b/tools/xl/xl_vcpu.c @@ -283,7 +283,7 @@ int main_vcpupin(int argc, char **argv) } /* Only hard affinity matters here */ - if (!ignore_masks) { + if (!ignore_masks && hard) { libxl_dominfo dominfo; if (libxl_domain_info(ctx, &dominfo, domid)) {