All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gnttab: fix "don't use possibly unbounded tail calls"
@ 2017-08-21  8:34 Jan Beulich
  2017-08-21 10:03 ` Andrew Cooper
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2017-08-21  8:34 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Ian Jackson, Tim Deegan

The compat mode code also needs adjustment to deal with the changed
return value from gnttab_copy().

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/common/compat/grant_table.c
+++ b/xen/common/compat/grant_table.c
@@ -258,9 +258,9 @@ int compat_grant_table_op(unsigned int c
                 rc = gnttab_copy(guest_handle_cast(nat.uop, gnttab_copy_t), n);
             if ( rc > 0 )
             {
-                ASSERT(rc < n);
-                i -= n - rc;
-                n = rc;
+                ASSERT(rc <= n);
+                i -= rc;
+                n -= rc;
             }
             if ( rc >= 0 )
             {




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

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

* Re: [PATCH] gnttab: fix "don't use possibly unbounded tail calls"
  2017-08-21  8:34 [PATCH] gnttab: fix "don't use possibly unbounded tail calls" Jan Beulich
@ 2017-08-21 10:03 ` Andrew Cooper
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cooper @ 2017-08-21 10:03 UTC (permalink / raw)
  To: Jan Beulich, xen-devel
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Tim Deegan, Ian Jackson

On 21/08/17 09:34, Jan Beulich wrote:
> The compat mode code also needs adjustment to deal with the changed
> return value from gnttab_copy().
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

/sigh - There's always another one, isn't there.

The patch should mention that it is part of XSA-226. With that,
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

>
> --- a/xen/common/compat/grant_table.c
> +++ b/xen/common/compat/grant_table.c
> @@ -258,9 +258,9 @@ int compat_grant_table_op(unsigned int c
>                  rc = gnttab_copy(guest_handle_cast(nat.uop, gnttab_copy_t), n);
>              if ( rc > 0 )
>              {
> -                ASSERT(rc < n);
> -                i -= n - rc;
> -                n = rc;
> +                ASSERT(rc <= n);
> +                i -= rc;
> +                n -= rc;
>              }
>              if ( rc >= 0 )
>              {
>
>
>


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

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

end of thread, other threads:[~2017-08-21 10:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-21  8:34 [PATCH] gnttab: fix "don't use possibly unbounded tail calls" Jan Beulich
2017-08-21 10:03 ` Andrew Cooper

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.