This is a note to let you know that I've just added the patch titled xen/io/ring.h: new macro to detect whether there are too many requests on the ring to the 3.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: xen-io-ring.h-new-macro-to-detect-whether-there-are-too-many-requests-on-the-ring.patch and it can be found in the queue-3.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 79c4d036e08cdcd9403047a37cbc9e37b5ee86b4 Mon Sep 17 00:00:00 2001 From: Jan Beulich <jbeulich@xxxxxxxx> Date: Mon, 17 Jun 2013 15:16:33 -0400 Subject: xen/io/ring.h: new macro to detect whether there are too many requests on the ring From: Jan Beulich <jbeulich@xxxxxxxx> 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@xxxxxxxxxx>. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx> Signed-off-by: Ben Hutchings <ben@xxxxxxxxxxxxxxx> Cc: Yijing Wang <wangyijing@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- include/xen/interface/io/ring.h | 5 +++++ 1 file changed, 5 insertions(+) --- a/include/xen/interface/io/ring.h +++ b/include/xen/interface/io/ring.h @@ -188,6 +188,11 @@ struct __name##_back_ring { \ #define RING_REQUEST_CONS_OVERFLOW(_r, _cons) \ (((_cons) - (_r)->rsp_prod_pvt) >= RING_SIZE(_r)) +/* Ill-behaved frontend determination: Can there be this many requests? */ +#define RING_REQUEST_PROD_OVERFLOW(_r, _prod) \ + (((_prod) - (_r)->rsp_prod_pvt) > RING_SIZE(_r)) + + #define RING_PUSH_REQUESTS(_r) do { \ wmb(); /* back sees requests /before/ updated producer index */ \ (_r)->sring->req_prod = (_r)->req_prod_pvt; \ Patches currently in stable-queue which might be from jbeulich@xxxxxxxx are queue-3.4/xen-events-mask-events-when-changing-their-vcpu-binding.patch queue-3.4/xen-blkback-check-for-insane-amounts-of-request-on-the-ring-v6.patch queue-3.4/xen-io-ring.h-new-macro-to-detect-whether-there-are-too-many-requests-on-the-ring.patch queue-3.4/xen-boot-disable-bios-smp-mp-table-search.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html