xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] io/ring.h: drop unused and broken *_RING_ATTACH() macros
@ 2013-06-11  8:47 Jan Beulich
  2013-06-11 10:09 ` Keir Fraser
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2013-06-11  8:47 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 1498 bytes --]

Initializing r*_prod_pvt and r*_cons from independent shared ring
fields is broken, as other macros in this header rely on them being
coupled. Furthermore using the backend variant would also imply a
security vulnerability.

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

--- a/xen/include/public/io/ring.h
+++ b/xen/include/public/io/ring.h
@@ -174,21 +174,6 @@ typedef struct __name##_back_ring __name
     (_r)->sring = (_s);                                                 \
 } while (0)
 
-/* Initialize to existing shared indexes -- for recovery */
-#define FRONT_RING_ATTACH(_r, _s, __size) do {                          \
-    (_r)->sring = (_s);                                                 \
-    (_r)->req_prod_pvt = (_s)->req_prod;                                \
-    (_r)->rsp_cons = (_s)->rsp_prod;                                    \
-    (_r)->nr_ents = __RING_SIZE(_s, __size);                            \
-} while (0)
-
-#define BACK_RING_ATTACH(_r, _s, __size) do {                           \
-    (_r)->sring = (_s);                                                 \
-    (_r)->rsp_prod_pvt = (_s)->rsp_prod;                                \
-    (_r)->req_cons = (_s)->req_prod;                                    \
-    (_r)->nr_ents = __RING_SIZE(_s, __size);                            \
-} while (0)
-
 /* How big is this ring? */
 #define RING_SIZE(_r)                                                   \
     ((_r)->nr_ents)




[-- Attachment #2: ring-drop-attach.patch --]
[-- Type: text/plain, Size: 1552 bytes --]

io/ring.h: drop unused and broken *_RING_ATTACH() macros

Initializing r*_prod_pvt and r*_cons from independent shared ring
fields is broken, as other macros in this header rely on them being
coupled. Furthermore using the backend variant would also imply a
security vulnerability.

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

--- a/xen/include/public/io/ring.h
+++ b/xen/include/public/io/ring.h
@@ -174,21 +174,6 @@ typedef struct __name##_back_ring __name
     (_r)->sring = (_s);                                                 \
 } while (0)
 
-/* Initialize to existing shared indexes -- for recovery */
-#define FRONT_RING_ATTACH(_r, _s, __size) do {                          \
-    (_r)->sring = (_s);                                                 \
-    (_r)->req_prod_pvt = (_s)->req_prod;                                \
-    (_r)->rsp_cons = (_s)->rsp_prod;                                    \
-    (_r)->nr_ents = __RING_SIZE(_s, __size);                            \
-} while (0)
-
-#define BACK_RING_ATTACH(_r, _s, __size) do {                           \
-    (_r)->sring = (_s);                                                 \
-    (_r)->rsp_prod_pvt = (_s)->rsp_prod;                                \
-    (_r)->req_cons = (_s)->req_prod;                                    \
-    (_r)->nr_ents = __RING_SIZE(_s, __size);                            \
-} while (0)
-
 /* How big is this ring? */
 #define RING_SIZE(_r)                                                   \
     ((_r)->nr_ents)

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

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

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

end of thread, other threads:[~2013-06-11 10:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-11  8:47 [PATCH] io/ring.h: drop unused and broken *_RING_ATTACH() macros Jan Beulich
2013-06-11 10:09 ` Keir Fraser

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