[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 19/25] argo: limit the max number of notify requests in a single operation.



Very basic implementation: a fixed limit of 256.

Signed-off-by: Christopher Clark <christopher.clark6@xxxxxxxxxxxxxx>
---
 xen/common/argo.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/xen/common/argo.c b/xen/common/argo.c
index cc908f4..0858fb2 100644
--- a/xen/common/argo.c
+++ b/xen/common/argo.c
@@ -27,6 +27,7 @@
 #include <xsm/xsm.h>
 
 #define ARGO_MAX_RINGS_PER_DOMAIN       128U
+#define ARGO_MAX_NOTIFY_COUNT           256U
 
 DEFINE_XEN_GUEST_HANDLE(argo_pfn_t);
 DEFINE_XEN_GUEST_HANDLE(argo_addr_t);
@@ -1480,6 +1481,12 @@ argo_notify(struct domain *d,
             if ( ret )
                 break;
 
+            if ( ring_data.nent > ARGO_MAX_NOTIFY_COUNT )
+            {
+                ret = -EACCES;
+                break;
+            }
+
             {
                 /*
                  * This is a guest pointer passed as a field in a struct
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.