summaryrefslogtreecommitdiff
path: root/x11
diff options
context:
space:
mode:
authorxtraeme <xtraeme>2005-09-18 19:51:55 +0000
committerxtraeme <xtraeme>2005-09-18 19:51:55 +0000
commit5333587dca99a8d5c30e06c9396fcd5d965e7127 (patch)
tree67f62627d07904c7fe78bec48a45edd2d563d107 /x11
parent26d906c97354ba466a3750346555545bc93ee2ef (diff)
downloadpkgsrc-5333587dca99a8d5c30e06c9396fcd5d965e7127.tar.gz
Apply patch from FreeBSD ports to fix CAN-2005-2495.
Bump BUILDLINK_RECOMMENDED and PKGREVISION.
Diffstat (limited to 'x11')
-rw-r--r--x11/XFree86-libs/Makefile4
-rw-r--r--x11/XFree86-libs/buildlink3.mk4
-rw-r--r--x11/XFree86-libs/distinfo3
-rw-r--r--x11/XFree86-libs/patches/patch-at187
4 files changed, 193 insertions, 5 deletions
diff --git a/x11/XFree86-libs/Makefile b/x11/XFree86-libs/Makefile
index 961e8babd21..8476a31cede 100644
--- a/x11/XFree86-libs/Makefile
+++ b/x11/XFree86-libs/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.19 2005/04/11 21:48:04 tv Exp $
+# $NetBSD: Makefile,v 1.20 2005/09/18 19:51:55 xtraeme Exp $
DISTNAME= ${DISTFILES}
PKGNAME= XFree86-libs-${XF_VER}
-PKGREVISION= 3
+PKGREVISION= 4
CATEGORIES= x11
MASTER_SITES= ${MASTER_SITE_XFREE}
DISTFILES= XFree86-${XF_VER}-src-1.tgz XFree86-${XF_VER}-src-2.tgz \
diff --git a/x11/XFree86-libs/buildlink3.mk b/x11/XFree86-libs/buildlink3.mk
index e92446ec35c..9e5ea05752e 100644
--- a/x11/XFree86-libs/buildlink3.mk
+++ b/x11/XFree86-libs/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.4 2004/09/16 19:33:09 minskim Exp $
+# $NetBSD: buildlink3.mk,v 1.5 2005/09/18 19:51:55 xtraeme Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
XFREE86_LIBS_BUILDLINK3_MK:= ${XFREE86_LIBS_BUILDLINK3_MK}+
@@ -19,7 +19,7 @@ BUILDLINK_PACKAGES:= XFree86-libs ${BUILDLINK_PACKAGES}
.if !empty(XFREE86_LIBS_BUILDLINK3_MK:M+)
BUILDLINK_DEPENDS.XFree86-libs+= XFree86-libs>=4.4.0
-BUILDLINK_RECOMMENDED.XFree86-libs+= XFree86-libs>=4.4.0nb2
+BUILDLINK_RECOMMENDED.XFree86-libs+= XFree86-libs>=4.4.0nb4
BUILDLINK_PKGSRCDIR.XFree86-libs?= ../../x11/XFree86-libs
BUILDLINK_TRANSFORM.XFree86-libs+= -e "s|/${X11ROOT_PREFIX}/|/|"
diff --git a/x11/XFree86-libs/distinfo b/x11/XFree86-libs/distinfo
index a92f70f7fbd..a8ede98d5a3 100644
--- a/x11/XFree86-libs/distinfo
+++ b/x11/XFree86-libs/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.9 2005/02/23 17:36:09 wiz Exp $
+$NetBSD: distinfo,v 1.10 2005/09/18 19:51:55 xtraeme Exp $
SHA1 (XFree86-4.4.0-src-1.tgz) = 44b38a7044c82d0b2f785b0e6a935349abcb5d79
RMD160 (XFree86-4.4.0-src-1.tgz) = 40917951f1f661bfa28450771bbe86e8f0dd2549
@@ -31,3 +31,4 @@ SHA1 (patch-ap) = e2d533dd24e176e20fb1af7c8791e2670aad5c20
SHA1 (patch-aq) = 398fbbeca94beb6e4a878941d1b825d0b734e11b
SHA1 (patch-ar) = c9ad52d94aedd94d7c0e0dc254d02cde5e33b637
SHA1 (patch-as) = c0b27ef82c688c535fdd46cb5de3315e24677fc6
+SHA1 (patch-at) = 7cd02712c1ae4ca070564d2f7b5cb4e3e5b6e93b
diff --git a/x11/XFree86-libs/patches/patch-at b/x11/XFree86-libs/patches/patch-at
new file mode 100644
index 00000000000..9056ef98577
--- /dev/null
+++ b/x11/XFree86-libs/patches/patch-at
@@ -0,0 +1,187 @@
+$NetBSD: patch-at,v 1.3 2005/09/18 19:51:55 xtraeme Exp $
+
+Single patch to fix CAN-2005-2495.
+
+--- programs/Xserver/afb/afbpixmap.c.orig Fri Apr 23 20:59:39 2004
++++ programs/Xserver/afb/afbpixmap.c Sun Sep 18 04:56:02 2005
+@@ -73,10 +73,14 @@
+ int depth;
+ {
+ PixmapPtr pPixmap;
+- int datasize;
+- int paddedWidth;
++ size_t datasize;
++ size_t paddedWidth;
+
+ paddedWidth = BitmapBytePad(width);
++
++ if (paddedWidth > 32767 || height > 32767 || depth > 4)
++ return NullPixmap;
++
+ datasize = height * paddedWidth * depth;
+ pPixmap = AllocatePixmap(pScreen, datasize);
+ if (!pPixmap)
+--- programs/Xserver/cfb/cfbpixmap.c.orig Fri Apr 23 21:00:12 2004
++++ programs/Xserver/cfb/cfbpixmap.c Sun Sep 18 04:56:02 2005
+@@ -70,10 +70,13 @@
+ int depth;
+ {
+ PixmapPtr pPixmap;
+- int datasize;
+- int paddedWidth;
++ size_t datasize;
++ size_t paddedWidth;
+
+ paddedWidth = PixmapBytePad(width, depth);
++
++ if (paddedWidth / 4 > 32767 || height > 32767)
++ return NullPixmap;
+ datasize = height * paddedWidth;
+ pPixmap = AllocatePixmap(pScreen, datasize);
+ if (!pPixmap)
+--- programs/Xserver/dix/dispatch.c.orig Mon Dec 13 02:23:05 2004
++++ programs/Xserver/dix/dispatch.c Sun Sep 18 04:56:02 2005
+@@ -1506,6 +1506,23 @@
+ client->errorValue = 0;
+ return BadValue;
+ }
++ if (stuff->width > 32767 || stuff->height > 32767)
++ {
++ /* It is allowed to try and allocate a pixmap which is larger than
++ * 32767 in either dimension. However, all of the framebuffer code
++ * is buggy and does not reliably draw to such big pixmaps, basically
++ * because the Region data structure operates with signed shorts
++ * for the rectangles in it.
++ *
++ * Furthermore, several places in the X server computes the
++ * size in bytes of the pixmap and tries to store it in an
++ * integer. This integer can overflow and cause the allocated size
++ * to be much smaller.
++ *
++ * So, such big pixmaps are rejected here with a BadAlloc
++ */
++ return BadAlloc;
++ }
+ if (stuff->depth != 1)
+ {
+ pDepth = pDraw->pScreen->allowedDepths;
+--- programs/Xserver/dix/pixmap.c.orig Fri Apr 23 21:04:44 2004
++++ programs/Xserver/dix/pixmap.c Sun Sep 18 04:56:02 2005
+@@ -126,6 +126,9 @@
+ unsigned size;
+ int i;
+
++ if (pScreen->totalPixmapSize > ((size_t)-1) - pixDataSize)
++ return NullPixmap;
++
+ pPixmap = (PixmapPtr)xalloc(pScreen->totalPixmapSize + pixDataSize);
+ if (!pPixmap)
+ return NullPixmap;
+--- programs/Xserver/fb/fbpixmap.c.orig Mon Aug 9 05:40:50 2004
++++ programs/Xserver/fb/fbpixmap.c Sun Sep 18 04:56:02 2005
+@@ -32,12 +32,14 @@
+ fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp)
+ {
+ PixmapPtr pPixmap;
+- int datasize;
+- int paddedWidth;
++ size_t datasize;
++ size_t paddedWidth;
+ int adjust;
+ int base;
+
+ paddedWidth = ((width * bpp + FB_MASK) >> FB_SHIFT) * sizeof (FbBits);
++ if (paddedWidth / 4 > 32767 || height > 32767)
++ return NullPixmap;
+ datasize = height * paddedWidth;
+ #ifdef PIXPRIV
+ base = pScreen->totalPixmapSize;
+--- programs/Xserver/hw/xfree86/xaa/xaaInit.c.orig Fri Jul 30 22:30:56 2004
++++ programs/Xserver/hw/xfree86/xaa/xaaInit.c Sun Sep 18 04:56:02 2005
+@@ -498,6 +498,9 @@
+ XAAPixmapPtr pPriv;
+ PixmapPtr pPix = NULL;
+ int size = w * h;
++
++ if (w > 32767 || h > 32767)
++ return NullPixmap;
+
+ if (!infoRec->offscreenDepthsInitialized)
+ XAAInitializeOffscreenDepths (pScreen);
+--- programs/Xserver/hw/xfree86/xf4bpp/ppcPixmap.c.orig Fri Apr 23 21:54:17 2004
++++ programs/Xserver/hw/xfree86/xf4bpp/ppcPixmap.c Sun Sep 18 04:56:02 2005
+@@ -85,7 +85,7 @@
+ int depth ;
+ {
+ register PixmapPtr pPixmap = (PixmapPtr)NULL;
+- int size ;
++ size_t size ;
+
+ TRACE(("xf4bppCreatePixmap(pScreen=0x%x, width=%d, height=%d, depth=%d)\n", pScreen, width, height, depth)) ;
+
+@@ -93,6 +93,10 @@
+ return (PixmapPtr) NULL ;
+
+ size = PixmapBytePad(width, depth);
++
++ if (size / 4 > 32767 || height > 32767)
++ return (PixmapPtr) NULL ;
++
+ pPixmap = AllocatePixmap (pScreen, (height * size));
+
+ if ( !pPixmap )
+--- programs/Xserver/ilbm/ilbmpixmap.c.orig Fri Apr 23 21:54:22 2004
++++ programs/Xserver/ilbm/ilbmpixmap.c Sun Sep 18 04:56:02 2005
+@@ -75,10 +75,12 @@
+ int depth;
+ {
+ PixmapPtr pPixmap;
+- int datasize;
+- int paddedWidth;
++ size_t datasize;
++ size_t paddedWidth;
+
+ paddedWidth = BitmapBytePad(width);
++ if (paddedWidth > 32767 || height > 32767 || depth > 4)
++ return NullPixmap;
+ datasize = height * paddedWidth * depth;
+ pPixmap = AllocatePixmap(pScreen, datasize);
+ if (!pPixmap)
+--- programs/Xserver/iplan2p4/iplpixmap.c.orig Fri Apr 23 21:54:24 2004
++++ programs/Xserver/iplan2p4/iplpixmap.c Sun Sep 18 04:56:02 2005
+@@ -74,12 +74,14 @@
+ int depth;
+ {
+ PixmapPtr pPixmap;
+- int datasize;
+- int paddedWidth;
++ size_t datasize;
++ size_t paddedWidth;
+ int ipad=INTER_PLANES*2 - 1;
+
+ paddedWidth = PixmapBytePad(width, depth);
+ paddedWidth = (paddedWidth + ipad) & ~ipad;
++ if (paddedWidth / 4 > 32767 || height > 32767)
++ return NullPixmap;
+ datasize = height * paddedWidth;
+ pPixmap = AllocatePixmap(pScreen, datasize);
+ if (!pPixmap)
+--- programs/Xserver/mfb/mfbpixmap.c.orig Fri Nov 14 17:48:57 2003
++++ programs/Xserver/mfb/mfbpixmap.c Sun Sep 18 04:56:02 2005
+@@ -72,12 +72,14 @@
+ int depth;
+ {
+ PixmapPtr pPixmap;
+- int datasize;
+- int paddedWidth;
++ size_t datasize;
++ size_t paddedWidth;
+
+ if (depth != 1)
+ return NullPixmap;
+ paddedWidth = BitmapBytePad(width);
++ if (paddedWidth / 4 > 32767 || height > 32767)
++ return NullPixmap;
+ datasize = height * paddedWidth;
+ pPixmap = AllocatePixmap(pScreen, datasize);
+ if (!pPixmap)