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

Re: [PATCH v2] libxc: avoid clobbering errno in xc_domain_pod_target()


  • To: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 10 Dec 2021 14:54:39 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bvQaTh/W4/ZFBNazhXfSywTqj098D6zTo+tO7eNR/ws=; b=HdoxRSo8957hZ6kZ8xVUqnhTahJHkbiFqzXOXxjU3l6LfmqxhBRfZhx+i4VW9J+KmZ+nx311b7qsVXG6QQIgtO2Ef2ml7PXA63ohSoexRxnMkH4NncEs0AGnahDc2VxQPevICf9yiJX3tWiViNLvFyf579QFd/jrWZgxKnH7hb0GbTtUbHZxCv0X/lP83PZ1gnYSc1Sdj/8USlSYx9w8BwcPvfnjJLAVOQaEq8LYcMSYc6yvTwpS9I1nOQzdANu3/4dXUlWLkisirNdpia9Nk+OMOhA8IqGcpV1NzpzFjt+MBW+4FDKrSCNCW3vBsvNOCTttZ+4C2dKbWc3d+soqbA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U40sF20vGotss51JPNM6y53Fl5AsddQy6uhRWfkPedtNBgHO6CqOI67eNG2Fr0pXwqeXDNQVt6sPEqJEZXNFh8nqK1X6EWKsIHuwGK0AiXNaGGs7oi7VctYafn1XdN5Tjg1i9iupQXRBqBpBI1j9lldYJ8qfC8tMJuNHLdHMhB+SeqmzkwbH947QaJ33r5Dfk8C6Nr+7RrQI2rmehsE4MVmi/232pYXSD5kJdRBwIX8SSosgNIz8PjTeLuYN4+AcHRTbegGskbTE5gquED8YKlfxLlhZIGKuPJDxBln0OcPIwsTEQxOVgQSL0BV8StnNOBS7S7dNazKGqSwZuVpH+g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Fri, 10 Dec 2021 13:54:54 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 10.12.2021 14:50, Bertrand Marquis wrote:
>> On 10 Dec 2021, at 13:11, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>>
>> do_memory_op() supplies return value and has "errno" set the usual way.
>> Don't overwrite "errno" with 1 (aka EPERM on at least Linux). There's
>> also no reason to overwrite "err".
>>
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

Thanks.

> But if err can really only be 0 or -1, I do wonder if the else forcing err to 
> 0 could
> be removed but I must say I have no idea if do_memory_op could return a value 
> >0.

Indeed - see ...

>> ---
>> While the hypervisor side of the hypercall gives the impression of being
>> able to return positive values as of 637a283f17eb ("PoD: Allow
>> pod_set_cache_target hypercall to be preempted"), due to the use of
>> "rc >= 0" there, afaict that's not actually the case. IOW "err" can
>> really only be 0 or -1 here, and hence its setting to zero may also be
>> worthwhile to drop.
>> ---

... this.

Jan




 


Rackspace

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