xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Juergen Gross <jgross@suse.com>
Cc: xen-devel@lists.xenproject.org
Subject: Re: [PATCH] include/public: add RING_RESPONSE_PROD_OVERFLOW macro
Date: Mon, 17 May 2021 11:38:04 +0200	[thread overview]
Message-ID: <26985871-d70d-2184-c27e-fe161127de5f@suse.com> (raw)
In-Reply-To: <20210512164800.26236-1-jgross@suse.com>

On 12.05.2021 18:48, Juergen Gross wrote:
> Add a new RING_RESPONSE_PROD_OVERFLOW() macro for being able to
> detect an ill-behaved backend tampering with the response producer
> index.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

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

> --- a/xen/include/public/io/ring.h
> +++ b/xen/include/public/io/ring.h
> @@ -259,6 +259,10 @@ typedef struct __name##_back_ring __name##_back_ring_t
>  #define RING_REQUEST_PROD_OVERFLOW(_r, _prod)                           \
>      (((_prod) - (_r)->rsp_prod_pvt) > RING_SIZE(_r))
>  
> +/* Ill-behaved backend determination: Can there be this many responses? */
> +#define RING_RESPONSE_PROD_OVERFLOW(_r, _prod)                          \
> +    (((_prod) - (_r)->rsp_cons) > RING_SIZE(_r))
> +
>  #define RING_PUSH_REQUESTS(_r) do {                                     \
>      xen_wmb(); /* back sees requests /before/ updated producer index */ \
>      (_r)->sring->req_prod = (_r)->req_prod_pvt;                         \
> 



      reply	other threads:[~2021-05-17  9:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-12 16:48 Juergen Gross
2021-05-17  9:38 ` Jan Beulich [this message]

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=26985871-d70d-2184-c27e-fe161127de5f@suse.com \
    --to=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=xen-devel@lists.xenproject.org \
    --subject='Re: [PATCH] include/public: add RING_RESPONSE_PROD_OVERFLOW macro' \
    /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

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