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

Re: [PATCH] xen: detect uninitialized xenbus in xenbus_init


  • To: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 19 Nov 2021 09:24:16 +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=flmX9PFhQZs53xscWkDSqgKIyEAwpQZmabzx+s9Uz58=; b=j3LG7Dl+38wNYp1XUgO1MjhGN8/MAm5Tvd1fydoVES89gxEioCDHtATbgkLHQXMPRIiCZbMmP9in+dgQFyxl5Z5Zlolv0rEjNc6oa/f+YmjgClzrGrQdtcn2GsCa429ATxnS9nA581OaAEQPxiA4KrnRkj2Pc81wFgVlzobo5eVLiI2kZhcbTvcQVUsbX2QRoJfCgNxH7h/ysyd9i7Xi9A3tlskn53xgw2e76J8oSdf7ZUvxzPUoqpBKf2XJWll+9Xr7nM8gTZn6yWVXmGtaWIMli8OVBugZm0NxvgBWZdf48u6RN3dSX5GohgJVak0/IhClfWAPCGqs1Fua5m6yEA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GdDdY7pqUei2F7/o6ys8IghU6gytgfUFDzFJOjZatPMMzgv27Pzms7oQEdnib4UEHaPf1+JzloH+m9pbgSrInE5EoKOv/tjCwhUBmrUzyCG7zUumibxnL2u9dR25oDsyVqchnWI4QwjvROjFfeXd1Wtb2fixwlIbMAmKD7XISFWW5LH87BtAa09BDnWxrtOTgSUPrcizFZuwU35dsQBmCHMSv2QPnuk/K4DrZOfVKJrlIElyelaeooopH49pptc7+ZEx6WQukdud+nPMjZtGwQOAUdN/xGdHBW8A5NUR1KSi6X8Va5ZLlmvb8ek1RIcE3oPrK/zpQD/Dmn+iSH5W2g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>, stable@xxxxxxxxxxxxxxx, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Fri, 19 Nov 2021 08:24:36 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 18.11.2021 23:24, Boris Ostrovsky wrote:
> On 11/18/21 4:00 PM, Stefano Stabellini wrote:
>>
>>          /*
>>           * Avoid truncation on 32-bit.
>>           * TODO: handle addresses >= 4G
>>           */
>>          if ( v >= ~0UL ) {
>>              err = -EINVAL;
>>              goto out_error;
>>          }
> 
> 
> Since this is only relevant to 32-bit kernels then "#if BITS_PER_LONG == 32".

Plus then > instead of >= (thus also making the comment actually decribe
the code) and ULONG_MAX instead of ~0UL, I would say.

Jan




 


Rackspace

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