From: "Jan Beulich" Subject: [PATCH] io/ring.h: drop unused and broken *_RING_ATTACH() macros Date: Tue, 11 Jun 2013 09:47:28 +0100 Message-ID: <51B7004002000078000DCFFF@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part5B6BB130.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part5B6BB130.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 --- 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 =3D (_s); = \ } while (0) =20 -/* Initialize to existing shared indexes -- for recovery */ -#define FRONT_RING_ATTACH(_r, _s, __size) do { \ - (_r)->sring =3D (_s); = \ - (_r)->req_prod_pvt =3D (_s)->req_prod; = \ - (_r)->rsp_cons =3D (_s)->rsp_prod; = \ - (_r)->nr_ents =3D __RING_SIZE(_s, __size); = \ -} while (0) - -#define BACK_RING_ATTACH(_r, _s, __size) do { \ - (_r)->sring =3D (_s); = \ - (_r)->rsp_prod_pvt =3D (_s)->rsp_prod; = \ - (_r)->req_cons =3D (_s)->req_prod; = \ - (_r)->nr_ents =3D __RING_SIZE(_s, __size); = \ -} while (0) - /* How big is this ring? */ #define RING_SIZE(_r) \ ((_r)->nr_ents) --=__Part5B6BB130.0__= Content-Type: text/plain; name="ring-drop-attach.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="ring-drop-attach.patch" io/ring.h: drop unused and broken *_RING_ATTACH() macros=0A=0AInitializing = r*_prod_pvt and r*_cons from independent shared ring=0Afields is broken, = as other macros in this header rely on them being=0Acoupled. Furthermore = using the backend variant would also imply a=0Asecurity vulnerability.=0A= =0ASigned-off-by: Jan Beulich =0A=0A--- a/xen/include/pu= blic/io/ring.h=0A+++ b/xen/include/public/io/ring.h=0A@@ -174,21 +174,6 @@ = typedef struct __name##_back_ring __name=0A (_r)->sring =3D (_s); = \=0A } while (0)=0A =0A-/* = Initialize to existing shared indexes -- for recovery */=0A-#define = FRONT_RING_ATTACH(_r, _s, __size) do { \=0A- = (_r)->sring =3D (_s); = \=0A- (_r)->req_prod_pvt =3D (_s)->req_prod; = \=0A- (_r)->rsp_cons =3D (_s)->rsp_prod; = \=0A- (_r)->nr_ents =3D __RING_SIZE(_s, __size); = \=0A-} while (0)=0A-=0A-#define BACK_RING_ATTACH(_r, _s, = __size) do { \=0A- (_r)->sring =3D (_s); = \=0A- (_r)->rsp_prod_pvt =3D = (_s)->rsp_prod; \=0A- (_r)->req_cons =3D = (_s)->req_prod; \=0A- (_r)->nr_ents = =3D __RING_SIZE(_s, __size); \=0A-} while = (0)=0A-=0A /* How big is this ring? */=0A #define RING_SIZE(_r) = \=0A ((_r)->nr_ents)=0A --=__Part5B6BB130.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__Part5B6BB130.0__=--