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

Re: [PATCH] x86emul: replace UB shifts


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Fri, 31 Jul 2020 11:50:06 +0100
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Fri, 31 Jul 2020 10:50:15 +0000
  • Ironport-sdr: U0rYzTZXmpNJz2TQ4Cf3cHdh0JXuKqzA2cK1XcU1UaqNGQtV0nJQNZGYPhi/fo38YIS7YQKztF 9HapsaWQ32f3pXiZnux1M35iTU95aruXBLenpV+Ils+OY4yT0kCHTI/03wdxlig0h9nr4wz6Fa ENsU1wnhBAeqt07N93ehua0ziM5VNsXAYkX6GuXSp0gplbLbnQLFZ6h23h+0T68mmJeVKcVqES HS91pnISWu6JWpux8wLGoTiSDERhsJ1NMaqejD2Z0ADAvFDWtOleSBpRK8aHwEKxOcBknPXdi0 vHA=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 31/07/2020 08:06, Jan Beulich wrote:
> Displacement values can be negative, hence we shouldn't left-shift them.
>
> While auditing shifts, I noticed a pair of missing parentheses, which
> also get added right here.
>
> Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

I'd suggest putting the UBSAN report into the commit message

(XEN) UBSAN: Undefined behaviour in x86_emulate/x86_emulate.c:3482:55
(XEN) left shift of negative value -2

Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Tested-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>



 


Rackspace

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