All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Tim Deegan <tim@xen.org>, Xen-devel <xen-devel@lists.xen.org>,
	Julien Grall <julien.grall@arm.com>,
	Jan Beulich <JBeulich@suse.com>
Subject: Re: [PATCH] xen/public: Correct the definition of GNTTAB_CACHE_SOURCE_GREF
Date: Tue, 17 Oct 2017 16:19:19 -0400	[thread overview]
Message-ID: <20171017201919.GF31442@char.us.oracle.com> (raw)
In-Reply-To: <1508249511-22385-1-git-send-email-andrew.cooper3@citrix.com>

On Tue, Oct 17, 2017 at 03:11:51PM +0100, Andrew Cooper wrote:
> Discovered when running the XSA-232 PoC on a UBSAN-enabled hypervisor.
> 
>   (d79) XSA-232 PoC
>   (XEN) ================================================================================
>   (XEN) UBSAN: Undefined behaviour in grant_table.c:3217:25
>   (XEN) left shift of 1 by 31 places cannot be represented in type 'int'
>   (XEN) ----[ Xen-4.10.0-rc  x86_64  debug=y   Tainted:    H ]----
> 
> Update all of the GNTTAB_CACHE_* constants to be unsigned integers.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: George Dunlap <George.Dunlap@eu.citrix.com>
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Tim Deegan <tim@xen.org>
> CC: Wei Liu <wei.liu2@citrix.com>
> CC: Julien Grall <julien.grall@arm.com>
> 
> This is a trivial bugfix, and is low risk for 4.10
> ---
>  xen/include/public/grant_table.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/xen/include/public/grant_table.h b/xen/include/public/grant_table.h
> index 018036e..180d62c 100644
> --- a/xen/include/public/grant_table.h
> +++ b/xen/include/public/grant_table.h
> @@ -589,9 +589,9 @@ struct gnttab_cache_flush {
>      } a;
>      uint16_t offset; /* offset from start of grant */
>      uint16_t length; /* size within the grant */
> -#define GNTTAB_CACHE_CLEAN          (1<<0)
> -#define GNTTAB_CACHE_INVAL          (1<<1)
> -#define GNTTAB_CACHE_SOURCE_GREF    (1<<31)
> +#define GNTTAB_CACHE_CLEAN          (1u<<0)
> +#define GNTTAB_CACHE_INVAL          (1u<<1)
> +#define GNTTAB_CACHE_SOURCE_GREF    (1u<<31)
>      uint32_t op;
>  };
>  typedef struct gnttab_cache_flush gnttab_cache_flush_t;
> -- 
> 2.1.4
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2017-10-17 20:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-17 14:11 [PATCH] xen/public: Correct the definition of GNTTAB_CACHE_SOURCE_GREF Andrew Cooper
2017-10-17 14:14 ` Wei Liu
2017-10-17 20:19 ` Konrad Rzeszutek Wilk [this message]
2017-10-19 11:11 ` Julien Grall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171017201919.GF31442@char.us.oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.