You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cve-2011-4818-extra.patch 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. From ef2807731903ff05a618fe2cbd532fe2472f7d0d Mon Sep 17 00:00:00 2001
  2. From: Adam Jackson <ajax@redhat.com>
  3. Date: Tue, 27 Sep 2011 14:56:00 -0400
  4. Subject: [PATCH] CVE-2011-4818: Additional coverage for swap barriers and
  5. hyperpipe
  6. These have since been dropped, so the straight backport does not cover
  7. these cases.
  8. Signed-off-by: Adam Jackson <ajax@redhat.com>
  9. ---
  10. glx/glxcmds.c | 30 ++++++++++++++++++++++++------
  11. 1 files changed, 24 insertions(+), 6 deletions(-)
  12. diff --git a/glx/glxcmds.c b/glx/glxcmds.c
  13. index 922a6c1..fd0df31 100644
  14. --- a/glx/glxcmds.c
  15. +++ b/glx/glxcmds.c
  16. @@ -2204,6 +2204,8 @@ int __glXDisp_BindSwapBarrierSGIX(__GLXclientState *cl, GLbyte *pc)
  17. int screen, rc;
  18. __GLXscreen *pGlxScreen;
  19. + REQUEST_SIZE_MATCH(xGLXBindSwapBarrierSGIXReq);
  20. +
  21. rc = dixLookupDrawable(&pDraw, drawable, client, 0, DixGetAttrAccess);
  22. pGlxScreen = glxGetScreen(pDraw->pScreen);
  23. if (rc == Success && (pDraw->type == DRAWABLE_WINDOW)) {
  24. @@ -2233,9 +2235,13 @@ int __glXDisp_QueryMaxSwapBarriersSGIX(__GLXclientState *cl, GLbyte *pc)
  25. (xGLXQueryMaxSwapBarriersSGIXReq *) pc;
  26. xGLXQueryMaxSwapBarriersSGIXReply reply;
  27. int screen = req->screen;
  28. + int err;
  29. __GLXscreen *pGlxScreen;
  30. - pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
  31. + REQUEST_SIZE_MATCH(xGLXQueryMaxSwapBarriersSGIXReq);
  32. + if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
  33. + return err;
  34. +
  35. if (pGlxScreen->swapBarrierFuncs)
  36. reply.max = pGlxScreen->swapBarrierFuncs->queryMaxSwapBarriersFunc(screen);
  37. else
  38. @@ -2265,14 +2271,17 @@ int __glXDisp_QueryHyperpipeNetworkSGIX(__GLXclientState *cl, GLbyte *pc)
  39. xGLXQueryHyperpipeNetworkSGIXReply reply;
  40. int screen = req->screen;
  41. void *rdata = NULL;
  42. -
  43. + int err;
  44. int length=0;
  45. int npipes=0;
  46. int n= 0;
  47. __GLXscreen *pGlxScreen;
  48. - pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
  49. + REQUEST_SIZE_MATCH(xGLXQueryHyperpipeNetworkSGIXReq);
  50. +
  51. + if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
  52. + return err;
  53. if (pGlxScreen->hyperpipeFuncs) {
  54. rdata =
  55. (pGlxScreen->hyperpipeFuncs->queryHyperpipeNetworkFunc(screen, &npipes, &n));
  56. @@ -2308,11 +2317,14 @@ int __glXDisp_DestroyHyperpipeConfigSGIX (__GLXclientState *cl, GLbyte *pc)
  57. int screen = req->screen;
  58. int success = GLX_BAD_HYPERPIPE_SGIX;
  59. int hpId ;
  60. + int err;
  61. __GLXscreen *pGlxScreen;
  62. hpId = req->hpId;
  63. - pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
  64. + REQUEST_SIZE_MATCH(xGLXDestroyHyperpipeConfigSGIXReq);
  65. + if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
  66. + return err;
  67. if (pGlxScreen->hyperpipeFuncs) {
  68. success = pGlxScreen->hyperpipeFuncs->destroyHyperpipeConfigFunc(screen, hpId);
  69. }
  70. @@ -2346,11 +2358,14 @@ int __glXDisp_QueryHyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc)
  71. int npipes=0;
  72. int n= 0;
  73. int hpId;
  74. + int err;
  75. __GLXscreen *pGlxScreen;
  76. hpId = req->hpId;
  77. - pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
  78. + REQUEST_SIZE_MATCH(xGLXQueryHyperpipeConfigSGIXReq);
  79. + if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
  80. + return err;
  81. if (pGlxScreen->hyperpipeFuncs) {
  82. rdata = pGlxScreen->hyperpipeFuncs->queryHyperpipeConfigFunc(screen, hpId,&npipes, &n);
  83. }
  84. @@ -2387,12 +2402,15 @@ int __glXDisp_HyperpipeConfigSGIX(__GLXclientState *cl, GLbyte *pc)
  85. xGLXHyperpipeConfigSGIXReply reply;
  86. int screen = req->screen;
  87. void *rdata;
  88. + int err;
  89. int npipes=0, networkId;
  90. int hpId=-1;
  91. __GLXscreen *pGlxScreen;
  92. - pGlxScreen = glxGetScreen(screenInfo.screens[screen]);
  93. + REQUEST_SIZE_MATCH(xGLXHyperpipeConfigSGIXReq);
  94. + if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
  95. + return err;
  96. networkId = (int)req->networkId;
  97. npipes = (int)req->npipes;
  98. rdata = (void *)(req +1);
  99. --
  100. 1.7.6