xen/io/ring.h: new macro to detect whether there are too many requests on the ring
authorJan Beulich <jbeulich@suse.com>
Mon, 17 Jun 2013 19:16:33 +0000 (15:16 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 2 Aug 2013 20:14:53 +0000 (22:14 +0200)
commit79c4d036e08cdcd9403047a37cbc9e37b5ee86b4
tree4375fc80b1a72c2efc162a83f40d7cff6431d012
parentc006981f6002083822d16a865f4d767e218ea001
xen/io/ring.h: new macro to detect whether there are too many requests on the ring

commit 8d9256906a97c24e97e016482b9be06ea2532b05 upstream.

Backends may need to protect themselves against an insane number of
produced requests stored by a frontend, in case they iterate over
requests until reaching the req_prod value. There can't be more
requests on the ring than the difference between produced requests
and produced (but possibly not yet published) responses.

This is a more strict alternative to a patch previously posted by
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
include/xen/interface/io/ring.h