xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen/public: Correct the definition of GNTTAB_CACHE_SOURCE_GREF
@ 2017-10-17 14:11 Andrew Cooper
  2017-10-17 14:14 ` Wei Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andrew Cooper @ 2017-10-17 14:11 UTC (permalink / raw)
  To: Xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk, George Dunlap,
	Andrew Cooper, Tim Deegan, Julien Grall, Jan Beulich

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>
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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] xen/public: Correct the definition of GNTTAB_CACHE_SOURCE_GREF
  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
  2017-10-19 11:11 ` Julien Grall
  2 siblings, 0 replies; 4+ messages in thread
From: Wei Liu @ 2017-10-17 14:14 UTC (permalink / raw)
  To: Andrew Cooper
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk, George Dunlap,
	Tim Deegan, Xen-devel, Julien Grall, Jan Beulich

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>

Reviewed-by: Wei Liu <wei.liu2@citrix.com>

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] xen/public: Correct the definition of GNTTAB_CACHE_SOURCE_GREF
  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
  2017-10-19 11:11 ` Julien Grall
  2 siblings, 0 replies; 4+ messages in thread
From: Konrad Rzeszutek Wilk @ 2017-10-17 20:19 UTC (permalink / raw)
  To: Andrew Cooper
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Tim Deegan, Xen-devel,
	Julien Grall, Jan Beulich

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] xen/public: Correct the definition of GNTTAB_CACHE_SOURCE_GREF
  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
@ 2017-10-19 11:11 ` Julien Grall
  2 siblings, 0 replies; 4+ messages in thread
From: Julien Grall @ 2017-10-19 11:11 UTC (permalink / raw)
  To: Andrew Cooper, Xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk, George Dunlap,
	Tim Deegan, Julien Grall, Jan Beulich

Hi Andrew,

On 17/10/17 15:11, 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>

Release-acked-by: Julien Grall <julien.grall@linaro.org>

Cheers,

> ---
> CC: George Dunlap <George.Dunlap@eu.citrix.com>
> CC: Jan Beulich <JBeulich@suse.com>
> CC: 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;
> 

-- 
Julien Grall

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-10-19 11:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2017-10-19 11:11 ` Julien Grall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).