diff options
author | Tim Yamin <plasmaroo@gentoo.org> | 2004-12-24 19:42:58 +0000 |
---|---|---|
committer | Tim Yamin <plasmaroo@gentoo.org> | 2004-12-24 19:42:58 +0000 |
commit | 4a6d6b0b49e62ef8c9d420acebdacbe10886dd7b (patch) | |
tree | 67131b3c53ae07c9bc9cebfbc54b14ef1a3e49b3 | |
parent | Added to ~ppc (diff) | |
download | historical-4a6d6b0b49e62ef8c9d420acebdacbe10886dd7b.tar.gz historical-4a6d6b0b49e62ef8c9d420acebdacbe10886dd7b.tar.bz2 historical-4a6d6b0b49e62ef8c9d420acebdacbe10886dd7b.zip |
Security bump; bugs #72452, #74392, #74464.
15 files changed, 1096 insertions, 69 deletions
diff --git a/sys-kernel/hardened-sources/Manifest b/sys-kernel/hardened-sources/Manifest index 428814ee15ab..4f17be1b5f1d 100644 --- a/sys-kernel/hardened-sources/Manifest +++ b/sys-kernel/hardened-sources/Manifest @@ -1,14 +1,16 @@ -MD5 480ad33ed1ba9f53128a0afd5ab27ad7 ChangeLog 10807 +MD5 d52beea9e4becac0c9cdd1eb88cd9c08 ChangeLog 10992 +MD5 bd0830e661b5db2e328ff31ef4b41024 hardened-sources-2.4.28-r1.ebuild 1022 MD5 0a473e60c059cb41c96a6bbcbff84769 metadata.xml 459 MD5 ec13a8435dc6785ca17db91918579f3d hardened-sources-2.4.27-r2.ebuild 1027 -MD5 91d88b3126d4cc0b7cc5a22819808e68 hardened-sources-2.4.27-r3.ebuild 1028 MD5 d4ecb98afe62804ab5f6aff4d9315a8e hardened-sources-2.4.28.ebuild 1792 +MD5 91d88b3126d4cc0b7cc5a22819808e68 hardened-sources-2.4.27-r3.ebuild 1028 +MD5 c8985a5695cfda1c35d1b433d62604ce files/2.4.28-selinux-binfmt_a.out.patch 1743 +MD5 8652613a5ac92aa0ad7fdf0cc6c01716 files/digest-hardened-sources-2.4.28 339 +MD5 3cfa2f10ac7a4d62112f84dcb047b050 files/digest-hardened-sources-2.4.27-r3 145 MD5 8850fb5244d9d10736d95a85f3c5b3f1 files/2.4.27-CAN-2004-0394.patch 448 -MD5 d1ccc2047be533c992f67270a150a210 files/2.4.27-cmdline-race.patch 388 -MD5 073eb0c263e55f7f1d72d14c8957f4e2 files/digest-hardened-sources-2.4.27-r2 145 MD5 4a0215139f9aebfe2cc2747743763f08 files/2.4.28-grsec-binfmt_a.out.patch 1887 -MD5 376d0153645489845937a4ffd83e761b files/2.4.28-grsec-cmdline-race.patch 352 -MD5 c8985a5695cfda1c35d1b433d62604ce files/2.4.28-selinux-binfmt_a.out.patch 1743 +MD5 073eb0c263e55f7f1d72d14c8957f4e2 files/digest-hardened-sources-2.4.27-r2 145 +MD5 d1ccc2047be533c992f67270a150a210 files/2.4.27-cmdline-race.patch 388 +MD5 fcf28c7e79f13550bec1b88ead0be365 files/digest-hardened-sources-2.4.28-r1 145 MD5 98e84c850a16b9cb458be21ae4fb82df files/2.4.28-selinux-cmdline-race.patch 352 -MD5 3cfa2f10ac7a4d62112f84dcb047b050 files/digest-hardened-sources-2.4.27-r3 145 -MD5 8652613a5ac92aa0ad7fdf0cc6c01716 files/digest-hardened-sources-2.4.28 339 +MD5 376d0153645489845937a4ffd83e761b files/2.4.28-grsec-cmdline-race.patch 352 diff --git a/sys-kernel/wolk-sources/ChangeLog b/sys-kernel/wolk-sources/ChangeLog index a9bc09bb9eb6..fe87d98569e3 100644 --- a/sys-kernel/wolk-sources/ChangeLog +++ b/sys-kernel/wolk-sources/ChangeLog @@ -1,6 +1,17 @@ # ChangeLog for sys-kernel/wolk-sources # Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/wolk-sources/ChangeLog,v 1.62 2004/11/27 18:57:28 plasmaroo Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/wolk-sources/ChangeLog,v 1.63 2004/12/24 19:42:58 plasmaroo Exp $ + +*wolk-sources-4.14-r12 (24 Dec 2004) + + 24 Dec 2004; <plasmaroo@gentoo.org> -wolk-sources-4.11-r14.ebuild, + +wolk-sources-4.11-r15.ebuild, -wolk-sources-4.14-r11.ebuild, + +wolk-sources-4.14-r12.ebuild, -wolk-sources-4.15-r4.ebuild, + -wolk-sources-4.9-r18.ebuild, +wolk-sources-4.9-r19.ebuild, + +files/wolk-sources-4.9s.CAN-2004-1056.patch, + +files/wolk-sources.CAN-2004-1016.patch, + +files/wolk-sources.CAN-2004-1056.patch, +files/wolk-sources.vma.patch: + Security bump; bugs #72452, #74392, #74464. *wolk-sources-4.9-r18 (27 Nov 2004) diff --git a/sys-kernel/wolk-sources/Manifest b/sys-kernel/wolk-sources/Manifest index 2076bf46bf4b..881826ee87dc 100644 --- a/sys-kernel/wolk-sources/Manifest +++ b/sys-kernel/wolk-sources/Manifest @@ -1,18 +1,19 @@ -MD5 d8098be844e8c32e4dc480879a02d118 ChangeLog 20585 +MD5 95ef00cc3e93d153a381533c87cbc747 ChangeLog 21093 +MD5 fa40fe208bffd704d78fc7e4b44cf049 wolk-sources-4.14-r12.ebuild 2716 +MD5 fd0fab9657cbbb5bb971b2583c299bac wolk-sources-4.11-r15.ebuild 3739 MD5 6fd890f722da90b57c3c3f37ff79c75e metadata.xml 226 -MD5 8f77e25c4dabd3d1ad28b1b33f7d41f0 wolk-sources-4.14-r11.ebuild 2609 -MD5 eac203134a13a9fd63d4ea4deb6afbf9 wolk-sources-4.9-r18.ebuild 6494 -MD5 ee7852b5a8aa249aed80a37376968d91 wolk-sources-4.15-r4.ebuild 1722 -MD5 bbf6502fc06f70f38910a62efae92d24 wolk-sources-4.11-r14.ebuild 3471 +MD5 d1dac2fbdd62f39a8c8927914205c5c9 wolk-sources-4.9-r19.ebuild 6767 MD5 0f66013f643c79c97fda489618a4e2fd files/wolk-sources.CAN-2004-0535.patch 476 +MD5 e47f4118ace22fbcd917d36fdc648c3c files/wolk-sources-4.9s.CAN-2004-1056.patch 11020 MD5 d5efa40a4cca5b1a29d16204dd1f3a32 files/wolk-4.9s-page.h.patch 635 MD5 b0a1f80aff51d6601e8924329023b241 files/wolk-sources.AF_UNIX.patch 515 MD5 aa193a78c4f2fdd248f992db935c7895 files/wolk-sources-4.9s.CAN-2004-0010.patch 6065 MD5 ac42024b6e6ee1e2165914db4b22a61c files/wolk-sources.CAN-2004-0178.patch 424 -MD5 30e9fd1fbb477c5fc965dbf0fe41f3e8 files/digest-wolk-sources-4.9-r18 1480 +MD5 30e9fd1fbb477c5fc965dbf0fe41f3e8 files/digest-wolk-sources-4.9-r19 1480 MD5 21f3a4f186017d925067335e24db36a1 files/wolk-sources.CAN-2004-0109.patch 1877 MD5 94da93ba922ec8143b6d7a8470747fb5 files/wolk-4.9s-setup.c.patch 531 MD5 a4cb2b30bc0ad5f4f3913a6ec2ddfe1a files/wolk-sources.binfmt_elf.patch 2618 +MD5 6ed89b8ac0b47a4c25d3a616ef9245cc files/wolk-sources.vma.patch 11369 MD5 5bf9836a632a861728d33f9736bb7431 files/wolk-sources.CAN-2004-0133.patch 427 MD5 c9da1bc82b906f6abc648c056e7bf662 files/wolk-sources.FPULockup-53804.patch 354 MD5 dc18e982f8149588a291956481885a8c files/wolk-sources.CAN-2004-0495.patch 17549 @@ -23,18 +24,19 @@ MD5 b9a94233e1457787352e5f85e3e3582d files/wolk-sources.binfmt_a.out.patch 2009 MD5 d4a740ae56c2049247083af387a22a85 files/wolk-sources.CAN-2004-0394.patch 350 MD5 528da73c9e4a6fb017561e51dc0ab815 files/wolk-sources.CAN-2003-0643.patch 747 MD5 1e1fe7bb98c80db4644f4b7fd7dd5d32 files/wolk-sources.smbfs.patch 3434 +MD5 895c08b40b862ad74da9d49232ec83f1 files/digest-wolk-sources-4.11-r15 392 MD5 d4ef22c0e842ad7a48980130bf579e6e files/wolk-4.9s-speedstep.c.patch 777 -MD5 696de19810e15bd0d4373c0256efb3e0 files/digest-wolk-sources-4.14-r11 248 MD5 de75cfa969ed092578d9ddda6c5be334 files/wolk-sources.CAN-2004-0181.patch 1233 MD5 60d25ff310fc6abfdce39ec9e47345af files/wolk-sources.CAN-2004-0685.patch 2809 MD5 d1ccc2047be533c992f67270a150a210 files/wolk-sources.cmdlineLeak.patch 388 MD5 e7b64a09d10444ca699e9696a4035c3e files/patches.txt 12893 -MD5 895c08b40b862ad74da9d49232ec83f1 files/digest-wolk-sources-4.11-r14 392 +MD5 696de19810e15bd0d4373c0256efb3e0 files/digest-wolk-sources-4.14-r12 248 MD5 e77a93fdf26f06cf3ea5080b27211725 files/wolk-sources.CAN-2003-0985.patch 414 -MD5 379ebf50edb608e7dce21bbc0fd2d265 files/digest-wolk-sources-4.15-r4 227 +MD5 370cc17582bbb17605090009d24eba51 files/wolk-sources.CAN-2004-1016.patch 2168 MD5 2b3ddb8b8b15f8da35ade38544b57857 files/wolk-sources.XDRWrapFix.patch 1499 MD5 92f1b3aa68de326081b75653a77d64cf files/wolk-sources-4.9s.CAN-2004-0685.patch 2881 MD5 eaeda68a619caaddd5b8fdc5e7c39932 files/wolk-sources.CAN-2004-0177.patch 384 +MD5 757ee1239c3f14645ccea3640d551e11 files/wolk-sources.CAN-2004-1056.patch 11249 MD5 a61e57d5483a06f20da339d91f98fbb8 files/wolk-sources-4.9s.rtc_fix.patch 6769 MD5 e637c6fa41097ea2c4693d0766f2e1c5 files/do_brk_fix.patch 242 MD5 21ebf0ddc4b8ec4013470c4d243cd03b files/wolk-sources-4.9s.munmap.patch 826 diff --git a/sys-kernel/wolk-sources/files/digest-wolk-sources-4.11-r14 b/sys-kernel/wolk-sources/files/digest-wolk-sources-4.11-r15 index 49ba6c313556..49ba6c313556 100644 --- a/sys-kernel/wolk-sources/files/digest-wolk-sources-4.11-r14 +++ b/sys-kernel/wolk-sources/files/digest-wolk-sources-4.11-r15 diff --git a/sys-kernel/wolk-sources/files/digest-wolk-sources-4.14-r11 b/sys-kernel/wolk-sources/files/digest-wolk-sources-4.14-r12 index 0d04b5cf57f2..0d04b5cf57f2 100644 --- a/sys-kernel/wolk-sources/files/digest-wolk-sources-4.14-r11 +++ b/sys-kernel/wolk-sources/files/digest-wolk-sources-4.14-r12 diff --git a/sys-kernel/wolk-sources/files/digest-wolk-sources-4.15-r4 b/sys-kernel/wolk-sources/files/digest-wolk-sources-4.15-r4 deleted file mode 100644 index 3bdaa8aa52a4..000000000000 --- a/sys-kernel/wolk-sources/files/digest-wolk-sources-4.15-r4 +++ /dev/null @@ -1,3 +0,0 @@ -MD5 c439d5c93d7fc9a1480a90842465bb97 linux-2.4.20.tar.bz2 27421046 -MD5 9288e5f01df7fae699a0a87069e35c83 linux-2.4.20-wolk4.15s.patch.bz2 13952014 -MD5 07206015810a41da15f1ca27e4946312 wolk-sources-4.15-CAN-2004-0814.patch 82261 diff --git a/sys-kernel/wolk-sources/files/digest-wolk-sources-4.9-r18 b/sys-kernel/wolk-sources/files/digest-wolk-sources-4.9-r19 index 1fcc6f96f959..1fcc6f96f959 100644 --- a/sys-kernel/wolk-sources/files/digest-wolk-sources-4.9-r18 +++ b/sys-kernel/wolk-sources/files/digest-wolk-sources-4.9-r19 diff --git a/sys-kernel/wolk-sources/files/wolk-sources-4.9s.CAN-2004-1056.patch b/sys-kernel/wolk-sources/files/wolk-sources-4.9s.CAN-2004-1056.patch new file mode 100644 index 000000000000..b0b2a6d65598 --- /dev/null +++ b/sys-kernel/wolk-sources/files/wolk-sources-4.9s.CAN-2004-1056.patch @@ -0,0 +1,319 @@ +diff -ur linux-2.4.22/drivers/char/drm/i810.h linux-2.4.22.plasmaroo/drivers/char/drm/i810.h +--- linux-2.4.22/drivers/char/drm/i810.h 2001-08-08 17:42:14.000000000 +0100 ++++ linux-2.4.22.plasmaroo/drivers/char/drm/i810.h 2004-12-24 14:56:13.644644456 +0000 +@@ -113,4 +113,14 @@ + #define DRIVER_AGP_BUFFERS_MAP( dev ) \ + ((drm_i810_private_t *)((dev)->dev_private))->buffer_map + ++#define LOCK_TEST_WITH_RETURN( dev ) \ ++do { \ ++ if ( !_DRM_LOCK_IS_HELD( dev->lock.hw_lock->lock ) || \ ++ dev->lock.pid != current->pid ) { \ ++ DRM_ERROR( "%s called without lock held\n", \ ++ __FUNCTION__ ); \ ++ return -EINVAL; \ ++ } \ ++} while (0) ++ + #endif +diff -ur linux-2.4.22/drivers/char/drm/i810_dma.c linux-2.4.22.plasmaroo/drivers/char/drm/i810_dma.c +--- linux-2.4.22/drivers/char/drm/i810_dma.c 2002-11-28 23:53:12.000000000 +0000 ++++ linux-2.4.22.plasmaroo/drivers/char/drm/i810_dma.c 2004-12-24 14:57:28.626245520 +0000 +@@ -1071,10 +1071,7 @@ + drm_device_t *dev = priv->dev; + + DRM_DEBUG("i810_flush_ioctl\n"); +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_flush_ioctl called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + i810_flush_queue(dev); + return 0; +@@ -1096,10 +1093,7 @@ + if (copy_from_user(&vertex, (drm_i810_vertex_t *)arg, sizeof(vertex))) + return -EFAULT; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_dma_vertex called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + DRM_DEBUG("i810 dma vertex, idx %d used %d discard %d\n", + vertex.idx, vertex.used, vertex.discard); +@@ -1130,10 +1124,7 @@ + if (copy_from_user(&clear, (drm_i810_clear_t *)arg, sizeof(clear))) + return -EFAULT; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_clear_bufs called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + /* GH: Someone's doing nasty things... */ + if (!dev->dev_private) { +@@ -1154,10 +1145,7 @@ + + DRM_DEBUG("i810_swap_bufs\n"); + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_swap_buf called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + i810_dma_dispatch_swap( dev ); + return 0; +@@ -1193,10 +1181,7 @@ + if (copy_from_user(&d, (drm_i810_dma_t *)arg, sizeof(d))) + return -EFAULT; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_dma called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + d.granted = 0; + +@@ -1226,10 +1211,7 @@ + drm_i810_buf_priv_t *buf_priv; + drm_device_dma_t *dma = dev->dma; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_dma called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + if (copy_from_user(&d, (drm_i810_copy_t *)arg, sizeof(d))) + return -EFAULT; +@@ -1334,11 +1316,7 @@ + if (copy_from_user(&mc, (drm_i810_mc_t *)arg, sizeof(mc))) + return -EFAULT; + +- +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_dma_mc called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + i810_dma_dispatch_mc(dev, dma->buflist[mc.idx], mc.used, + mc.last_render ); +@@ -1382,10 +1360,7 @@ + drm_device_t *dev = priv->dev; + drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_fstatus called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + return I810_READ(0x30008); + } + +@@ -1396,10 +1371,7 @@ + drm_device_t *dev = priv->dev; + drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_ov0_flip called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + //Tell the overlay to update + I810_WRITE(0x30000,dev_priv->overlay_physical | 0x80000000); +diff -ur linux-2.4.22/drivers/char/drm/i830.h linux-2.4.22.plasmaroo/drivers/char/drm/i830.h +--- linux-2.4.22/drivers/char/drm/i830.h 2002-11-28 23:53:12.000000000 +0000 ++++ linux-2.4.22.plasmaroo/drivers/char/drm/i830.h 2004-12-24 14:56:13.658642328 +0000 +@@ -113,4 +113,14 @@ + #define DRIVER_AGP_BUFFERS_MAP( dev ) \ + ((drm_i830_private_t *)((dev)->dev_private))->buffer_map + ++#define LOCK_TEST_WITH_RETURN( dev ) \ ++do { \ ++ if ( !_DRM_LOCK_IS_HELD( dev->lock.hw_lock->lock ) || \ ++ dev->lock.pid != current->pid ) { \ ++ DRM_ERROR( "%s called without lock held\n", \ ++ __FUNCTION__ ); \ ++ return -EINVAL; \ ++ } \ ++} while (0) ++ + #endif +diff -ur linux-2.4.22/drivers/char/drm/i830_dma.c linux-2.4.22.plasmaroo/drivers/char/drm/i830_dma.c +--- linux-2.4.22/drivers/char/drm/i830_dma.c 2002-11-28 23:53:12.000000000 +0000 ++++ linux-2.4.22.plasmaroo/drivers/char/drm/i830_dma.c 2004-12-24 14:57:55.225201864 +0000 +@@ -1187,10 +1187,8 @@ + drm_device_t *dev = priv->dev; + + DRM_DEBUG("i830_flush_ioctl\n"); +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i830_flush_ioctl called without lock held\n"); +- return -EINVAL; +- } ++ ++ LOCK_TEST_WITH_RETURN(dev); + + i830_flush_queue(dev); + return 0; +@@ -1211,10 +1209,7 @@ + if (copy_from_user(&vertex, (drm_i830_vertex_t *)arg, sizeof(vertex))) + return -EFAULT; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i830_dma_vertex called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + DRM_DEBUG("i830 dma vertex, idx %d used %d discard %d\n", + vertex.idx, vertex.used, vertex.discard); +@@ -1241,10 +1236,7 @@ + if (copy_from_user(&clear, (drm_i830_clear_t *)arg, sizeof(clear))) + return -EFAULT; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i830_clear_bufs called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + /* GH: Someone's doing nasty things... */ + if (!dev->dev_private) { +@@ -1266,10 +1258,7 @@ + + DRM_DEBUG("i830_swap_bufs\n"); + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i830_swap_buf called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + i830_dma_dispatch_swap( dev ); + return 0; +@@ -1305,10 +1294,7 @@ + if (copy_from_user(&d, (drm_i830_dma_t *)arg, sizeof(d))) + return -EFAULT; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i830_dma called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + d.granted = 0; + +@@ -1338,10 +1324,7 @@ + drm_i830_buf_priv_t *buf_priv; + drm_device_dma_t *dma = dev->dma; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i830_dma called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + if (copy_from_user(&d, (drm_i830_copy_t *)arg, sizeof(d))) + return -EFAULT; +diff -ur linux-2.4.22/drivers/char/drm-4.0/drmP.h linux-2.4.22.plasmaroo/drivers/char/drm-4.0/drmP.h +--- linux-2.4.22/drivers/char/drm-4.0/drmP.h 2002-02-25 19:37:57.000000000 +0000 ++++ linux-2.4.22.plasmaroo/drivers/char/drm-4.0/drmP.h 2004-12-24 14:56:16.389227216 +0000 +@@ -294,6 +294,16 @@ + #define DRM_BUFCOUNT(x) ((x)->count - DRM_LEFTCOUNT(x)) + #define DRM_WAITCOUNT(dev,idx) DRM_BUFCOUNT(&dev->queuelist[idx]->waitlist) + ++#define LOCK_TEST_WITH_RETURN( dev ) \ ++do { \ ++ if ( !_DRM_LOCK_IS_HELD( dev->lock.hw_lock->lock ) || \ ++ dev->lock.pid != current->pid ) { \ ++ DRM_ERROR( "%s called without lock held\n", \ ++ __FUNCTION__ ); \ ++ return -EINVAL; \ ++ } \ ++} while (0) ++ + typedef int drm_ioctl_t(struct inode *inode, struct file *filp, + unsigned int cmd, unsigned long arg); + +diff -ur linux-2.4.22/drivers/char/drm-4.0/i810_dma.c linux-2.4.22.plasmaroo/drivers/char/drm-4.0/i810_dma.c +--- linux-2.4.22/drivers/char/drm-4.0/i810_dma.c 2003-06-13 15:51:32.000000000 +0100 ++++ linux-2.4.22.plasmaroo/drivers/char/drm-4.0/i810_dma.c 2004-12-24 14:56:16.401225392 +0000 +@@ -1249,10 +1249,7 @@ + drm_device_t *dev = priv->dev; + + DRM_DEBUG("i810_flush_ioctl\n"); +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_flush_ioctl called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + i810_flush_queue(dev); + return 0; +@@ -1274,10 +1271,7 @@ + if (copy_from_user(&vertex, (drm_i810_vertex_t *)arg, sizeof(vertex))) + return -EFAULT; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_dma_vertex called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + DRM_DEBUG("i810 dma vertex, idx %d used %d discard %d\n", + vertex.idx, vertex.used, vertex.discard); +@@ -1308,10 +1302,7 @@ + if (copy_from_user(&clear, (drm_i810_clear_t *)arg, sizeof(clear))) + return -EFAULT; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_clear_bufs called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + i810_dma_dispatch_clear( dev, clear.flags, + clear.clear_color, +@@ -1327,10 +1318,7 @@ + + DRM_DEBUG("i810_swap_bufs\n"); + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_swap_buf called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + i810_dma_dispatch_swap( dev ); + return 0; +@@ -1366,10 +1354,7 @@ + if (copy_from_user(&d, (drm_i810_dma_t *)arg, sizeof(d))) + return -EFAULT; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_dma called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + d.granted = 0; + +@@ -1399,10 +1384,7 @@ + drm_i810_buf_priv_t *buf_priv; + drm_device_dma_t *dma = dev->dma; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_dma called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + if (copy_from_user(&d, (drm_i810_copy_t *)arg, sizeof(d))) + return -EFAULT; diff --git a/sys-kernel/wolk-sources/files/wolk-sources.CAN-2004-1016.patch b/sys-kernel/wolk-sources/files/wolk-sources.CAN-2004-1016.patch new file mode 100644 index 000000000000..ad0b0dde0d47 --- /dev/null +++ b/sys-kernel/wolk-sources/files/wolk-sources.CAN-2004-1016.patch @@ -0,0 +1,58 @@ +===== include/linux/socket.h 1.12 vs edited ===== +--- 1.12/include/linux/socket.h 2004-09-09 06:40:01 +10:00 ++++ edited/include/linux/socket.h 2004-11-27 11:53:40 +11:00 +@@ -90,6 +90,10 @@ + (struct cmsghdr *)(ctl) : \ + (struct cmsghdr *)NULL) + #define CMSG_FIRSTHDR(msg) __CMSG_FIRSTHDR((msg)->msg_control, (msg)->msg_controllen) ++#define CMSG_OK(mhdr, cmsg) ((cmsg)->cmsg_len >= sizeof(struct cmsghdr) && \ ++ (cmsg)->cmsg_len <= (unsigned long) \ ++ ((mhdr)->msg_controllen - \ ++ ((char *)(cmsg) - (char *)(mhdr)->msg_control))) + + /* + * This mess will go away with glibc +===== net/core/scm.c 1.10 vs edited ===== +--- 1.10/net/core/scm.c 2004-05-31 05:08:14 +10:00 ++++ edited/net/core/scm.c 2004-11-27 11:48:55 +11:00 +@@ -127,9 +127,7 @@ + for too short ancillary data object at all! Oops. + OK, let's add it... + */ +- if (cmsg->cmsg_len < sizeof(struct cmsghdr) || +- (unsigned long)(((char*)cmsg - (char*)msg->msg_control) +- + cmsg->cmsg_len) > msg->msg_controllen) ++ if (!CMSG_OK(msg, cmsg)) + goto error; + + if (cmsg->cmsg_level != SOL_SOCKET) +===== net/ipv4/ip_sockglue.c 1.26 vs edited ===== +--- 1.26/net/ipv4/ip_sockglue.c 2004-07-01 06:10:53 +10:00 ++++ edited/net/ipv4/ip_sockglue.c 2004-11-27 11:49:45 +11:00 +@@ -146,11 +146,8 @@ + struct cmsghdr *cmsg; + + for (cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg)) { +- if (cmsg->cmsg_len < sizeof(struct cmsghdr) || +- (unsigned long)(((char*)cmsg - (char*)msg->msg_control) +- + cmsg->cmsg_len) > msg->msg_controllen) { ++ if (!CMSG_OK(msg, cmsg)) + return -EINVAL; +- } + if (cmsg->cmsg_level != SOL_IP) + continue; + switch (cmsg->cmsg_type) { +===== net/ipv6/datagram.c 1.20 vs edited ===== +--- 1.20/net/ipv6/datagram.c 2004-11-10 17:57:03 +11:00 ++++ edited/net/ipv6/datagram.c 2004-11-27 11:51:15 +11:00 +@@ -427,9 +427,7 @@ + int addr_type; + struct net_device *dev = NULL; + +- if (cmsg->cmsg_len < sizeof(struct cmsghdr) || +- (unsigned long)(((char*)cmsg - (char*)msg->msg_control) +- + cmsg->cmsg_len) > msg->msg_controllen) { ++ if (!CMSG_OK(msg, cmsg)) { + err = -EINVAL; + goto exit_f; + } diff --git a/sys-kernel/wolk-sources/files/wolk-sources.CAN-2004-1056.patch b/sys-kernel/wolk-sources/files/wolk-sources.CAN-2004-1056.patch new file mode 100644 index 000000000000..53b777acaac5 --- /dev/null +++ b/sys-kernel/wolk-sources/files/wolk-sources.CAN-2004-1056.patch @@ -0,0 +1,321 @@ +diff -ur linux-2.4.28/drivers/char/drm/i810.h linux-2.4.28.plasmaroo/drivers/char/drm/i810.h +--- linux-2.4.28/drivers/char/drm/i810.h 2003-11-28 18:26:20.000000000 +0000 ++++ linux-2.4.28.plasmaroo/drivers/char/drm/i810.h 2004-12-23 16:26:31.000000000 +0000 +@@ -114,4 +114,14 @@ + #define DRIVER_AGP_BUFFERS_MAP( dev ) \ + ((drm_i810_private_t *)((dev)->dev_private))->buffer_map + ++#define LOCK_TEST_WITH_RETURN( dev ) \ ++do { \ ++ if ( !_DRM_LOCK_IS_HELD( dev->lock.hw_lock->lock ) || \ ++ dev->lock.pid != current->pid ) { \ ++ DRM_ERROR( "%s called without lock held\n", \ ++ __FUNCTION__ ); \ ++ return -EINVAL; \ ++ } \ ++} while (0) ++ + #endif +diff -ur linux-2.4.28/drivers/char/drm/i810_dma.c linux-2.4.28.plasmaroo/drivers/char/drm/i810_dma.c +--- linux-2.4.28/drivers/char/drm/i810_dma.c 2004-02-18 13:36:31.000000000 +0000 ++++ linux-2.4.28.plasmaroo/drivers/char/drm/i810_dma.c 2004-12-23 16:27:16.000000000 +0000 +@@ -948,10 +948,7 @@ + drm_file_t *priv = filp->private_data; + drm_device_t *dev = priv->dev; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_flush_ioctl called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + i810_flush_queue(dev); + return 0; +@@ -973,10 +970,7 @@ + if (copy_from_user(&vertex, (drm_i810_vertex_t *)arg, sizeof(vertex))) + return -EFAULT; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_dma_vertex called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + if(vertex.idx < 0 || vertex.idx > dma->buf_count) return -EINVAL; + +@@ -1004,10 +998,7 @@ + if (copy_from_user(&clear, (drm_i810_clear_t *)arg, sizeof(clear))) + return -EFAULT; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_clear_bufs called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + /* GH: Someone's doing nasty things... */ + if (!dev->dev_private) { +@@ -1026,10 +1017,7 @@ + drm_file_t *priv = filp->private_data; + drm_device_t *dev = priv->dev; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_swap_buf called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + i810_dma_dispatch_swap( dev ); + return 0; +@@ -1064,10 +1052,7 @@ + if (copy_from_user(&d, (drm_i810_dma_t *)arg, sizeof(d))) + return -EFAULT; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_dma called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + d.granted = 0; + +@@ -1174,11 +1159,7 @@ + if (copy_from_user(&mc, (drm_i810_mc_t *)arg, sizeof(mc))) + return -EFAULT; + +- +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_dma_mc called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + i810_dma_dispatch_mc(dev, dma->buflist[mc.idx], mc.used, + mc.last_render ); +@@ -1223,10 +1204,7 @@ + drm_device_t *dev = priv->dev; + drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_fstatus called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + return I810_READ(0x30008); + } + +@@ -1237,10 +1215,7 @@ + drm_device_t *dev = priv->dev; + drm_i810_private_t *dev_priv = (drm_i810_private_t *)dev->dev_private; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_ov0_flip called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + //Tell the overlay to update + I810_WRITE(0x30000,dev_priv->overlay_physical | 0x80000000); +diff -ur linux-2.4.28/drivers/char/drm/i830.h linux-2.4.28.plasmaroo/drivers/char/drm/i830.h +--- linux-2.4.28/drivers/char/drm/i830.h 2003-11-28 18:26:20.000000000 +0000 ++++ linux-2.4.28.plasmaroo/drivers/char/drm/i830.h 2004-12-23 16:31:33.000000000 +0000 +@@ -154,4 +154,14 @@ + #define DRIVER_AGP_BUFFERS_MAP( dev ) \ + ((drm_i830_private_t *)((dev)->dev_private))->buffer_map + ++#define LOCK_TEST_WITH_RETURN( dev ) \ ++do { \ ++ if ( !_DRM_LOCK_IS_HELD( dev->lock.hw_lock->lock ) || \ ++ dev->lock.pid != current->pid ) { \ ++ DRM_ERROR( "%s called without lock held\n", \ ++ __FUNCTION__ ); \ ++ return -EINVAL; \ ++ } \ ++} while (0) ++ + #endif +diff -ur linux-2.4.28/drivers/char/drm/i830_dma.c linux-2.4.28.plasmaroo/drivers/char/drm/i830_dma.c +--- linux-2.4.28/drivers/char/drm/i830_dma.c 2004-02-18 13:36:31.000000000 +0000 ++++ linux-2.4.28.plasmaroo/drivers/char/drm/i830_dma.c 2004-12-23 16:32:08.000000000 +0000 +@@ -1330,10 +1330,7 @@ + drm_file_t *priv = filp->private_data; + drm_device_t *dev = priv->dev; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i830_flush_ioctl called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + i830_flush_queue(dev); + return 0; +@@ -1354,10 +1351,7 @@ + if (copy_from_user(&vertex, (drm_i830_vertex_t *)arg, sizeof(vertex))) + return -EFAULT; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i830_dma_vertex called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + DRM_DEBUG("i830 dma vertex, idx %d used %d discard %d\n", + vertex.idx, vertex.used, vertex.discard); +@@ -1384,10 +1378,7 @@ + if (copy_from_user(&clear, (drm_i830_clear_t *)arg, sizeof(clear))) + return -EFAULT; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i830_clear_bufs called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + /* GH: Someone's doing nasty things... */ + if (!dev->dev_private) { +@@ -1409,10 +1400,7 @@ + + DRM_DEBUG("i830_swap_bufs\n"); + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i830_swap_buf called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + i830_dma_dispatch_swap( dev ); + return 0; +@@ -1453,10 +1441,7 @@ + + DRM_DEBUG("%s\n", __FUNCTION__); + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i830_flip_buf called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + if (!dev_priv->page_flipping) + i830_do_init_pageflip( dev ); +@@ -1495,10 +1480,7 @@ + if (copy_from_user(&d, (drm_i830_dma_t *)arg, sizeof(d))) + return -EFAULT; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i830_dma called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + d.granted = 0; + +diff -ur linux-2.4.28/drivers/char/drm/i830_irq.c linux-2.4.28.plasmaroo/drivers/char/drm/i830_irq.c +--- linux-2.4.28/drivers/char/drm/i830_irq.c 2003-11-28 18:26:20.000000000 +0000 ++++ linux-2.4.28.plasmaroo/drivers/char/drm/i830_irq.c 2004-12-23 16:39:47.000000000 +0000 +@@ -130,10 +130,7 @@ + drm_i830_irq_emit_t emit; + int result; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i830_irq_emit called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + if ( !dev_priv ) { + DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ ); +diff -ur linux-2.4.28/drivers/char/drm-4.0/drmP.h linux-2.4.28.plasmaroo/drivers/char/drm-4.0/drmP.h +--- linux-2.4.28/drivers/char/drm-4.0/drmP.h 2004-02-18 13:36:31.000000000 +0000 ++++ linux-2.4.28.plasmaroo/drivers/char/drm-4.0/drmP.h 2004-12-23 16:21:30.000000000 +0000 +@@ -294,6 +294,16 @@ + #define DRM_BUFCOUNT(x) ((x)->count - DRM_LEFTCOUNT(x)) + #define DRM_WAITCOUNT(dev,idx) DRM_BUFCOUNT(&dev->queuelist[idx]->waitlist) + ++#define LOCK_TEST_WITH_RETURN( dev ) \ ++do { \ ++ if ( !_DRM_LOCK_IS_HELD( dev->lock.hw_lock->lock ) || \ ++ dev->lock.pid != current->pid ) { \ ++ DRM_ERROR( "%s called without lock held\n", \ ++ __FUNCTION__ ); \ ++ return -EINVAL; \ ++ } \ ++} while (0) ++ + typedef int drm_ioctl_t(struct inode *inode, struct file *filp, + unsigned int cmd, unsigned long arg); + +diff -ur linux-2.4.28/drivers/char/drm-4.0/i810_dma.c linux-2.4.28.plasmaroo/drivers/char/drm-4.0/i810_dma.c +--- linux-2.4.28/drivers/char/drm-4.0/i810_dma.c 2004-02-18 13:36:31.000000000 +0000 ++++ linux-2.4.28.plasmaroo/drivers/char/drm-4.0/i810_dma.c 2004-12-23 16:21:30.000000000 +0000 +@@ -1249,10 +1249,7 @@ + drm_device_t *dev = priv->dev; + + DRM_DEBUG("i810_flush_ioctl\n"); +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_flush_ioctl called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + i810_flush_queue(dev); + return 0; +@@ -1274,10 +1271,7 @@ + if (copy_from_user(&vertex, (drm_i810_vertex_t *)arg, sizeof(vertex))) + return -EFAULT; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_dma_vertex called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + DRM_DEBUG("i810 dma vertex, idx %d used %d discard %d\n", + vertex.idx, vertex.used, vertex.discard); +@@ -1308,10 +1302,7 @@ + if (copy_from_user(&clear, (drm_i810_clear_t *)arg, sizeof(clear))) + return -EFAULT; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_clear_bufs called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + i810_dma_dispatch_clear( dev, clear.flags, + clear.clear_color, +@@ -1327,10 +1318,7 @@ + + DRM_DEBUG("i810_swap_bufs\n"); + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_swap_buf called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + i810_dma_dispatch_swap( dev ); + return 0; +@@ -1366,10 +1354,7 @@ + if (copy_from_user(&d, (drm_i810_dma_t *)arg, sizeof(d))) + return -EFAULT; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_dma called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + d.granted = 0; + +@@ -1399,10 +1384,7 @@ + drm_i810_buf_priv_t *buf_priv; + drm_device_dma_t *dma = dev->dma; + +- if(!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) { +- DRM_ERROR("i810_dma called without lock held\n"); +- return -EINVAL; +- } ++ LOCK_TEST_WITH_RETURN(dev); + + if (copy_from_user(&d, (drm_i810_copy_t *)arg, sizeof(d))) + return -EFAULT; diff --git a/sys-kernel/wolk-sources/files/wolk-sources.vma.patch b/sys-kernel/wolk-sources/files/wolk-sources.vma.patch new file mode 100644 index 000000000000..188da50f6655 --- /dev/null +++ b/sys-kernel/wolk-sources/files/wolk-sources.vma.patch @@ -0,0 +1,352 @@ +diff -ur linux-2.4.28-gentoo-r2/arch/ia64/ia32/binfmt_elf32.c linux-2.4.28-gentoo-r3/arch/ia64/ia32/binfmt_elf32.c +--- linux-2.4.28-gentoo-r2/arch/ia64/ia32/binfmt_elf32.c 2004-11-27 20:50:07.000000000 +0000 ++++ linux-2.4.28-gentoo-r3/arch/ia64/ia32/binfmt_elf32.c 2004-12-24 14:34:29.531899728 +0000 +@@ -95,7 +95,11 @@ + vma->vm_private_data = NULL; + down_write(¤t->mm->mmap_sem); + { +- insert_vm_struct(current->mm, vma); ++ if (insert_vm_struct(current->mm, vma)) { ++ kmem_cache_free(vm_area_cachep, vma); ++ up_write(¤t->mm->mmap_sem); ++ return; ++ } + } + up_write(¤t->mm->mmap_sem); + } +@@ -117,7 +121,11 @@ + vma->vm_private_data = NULL; + down_write(¤t->mm->mmap_sem); + { +- insert_vm_struct(current->mm, vma); ++ if (insert_vm_struct(current->mm, vma)) { ++ kmem_cache_free(vm_area_cachep, vma); ++ up_write(¤t->mm->mmap_sem); ++ return; ++ } + } + up_write(¤t->mm->mmap_sem); + } +@@ -164,7 +172,7 @@ + { + unsigned long stack_base; + struct vm_area_struct *mpnt; +- int i; ++ int i, ret; + + stack_base = IA32_STACK_TOP - MAX_ARG_PAGES*PAGE_SIZE; + +@@ -188,7 +196,11 @@ + mpnt->vm_pgoff = 0; + mpnt->vm_file = NULL; + mpnt->vm_private_data = 0; +- insert_vm_struct(current->mm, mpnt); ++ if ((ret = insert_vm_struct(current->mm, mpnt))) { ++ up_write(¤t->mm->mmap_sem); ++ kmem_cache_free(vm_area_cachep, mpnt); ++ return ret; ++ } + current->mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT; + } + +diff -ur linux-2.4.28-gentoo-r2/arch/ia64/kernel/perfmon.c linux-2.4.28-gentoo-r3/arch/ia64/kernel/perfmon.c +--- linux-2.4.28-gentoo-r2/arch/ia64/kernel/perfmon.c 2004-11-27 20:50:07.000000000 +0000 ++++ linux-2.4.28-gentoo-r3/arch/ia64/kernel/perfmon.c 2004-12-24 14:34:29.534899272 +0000 +@@ -967,7 +967,8 @@ + * now insert the vma in the vm list for the process, must be + * done with mmap lock held + */ +- insert_vm_struct(mm, vma); ++ if(insert_vm_struct(mm, vma)) /* Handle -ENOMEM et al. */ ++ goto error; + + mm->total_vm += size >> PAGE_SHIFT; + +diff -ur linux-2.4.28-gentoo-r2/arch/ia64/mm/init.c linux-2.4.28-gentoo-r3/arch/ia64/mm/init.c +--- linux-2.4.28-gentoo-r2/arch/ia64/mm/init.c 2004-11-27 20:50:07.000000000 +0000 ++++ linux-2.4.28-gentoo-r3/arch/ia64/mm/init.c 2004-12-24 14:34:29.535899120 +0000 +@@ -105,7 +105,13 @@ + vma->vm_pgoff = 0; + vma->vm_file = NULL; + vma->vm_private_data = NULL; +- insert_vm_struct(current->mm, vma); ++ down_write(¤t->mm->mmap_sem); ++ if (insert_vm_struct(current->mm, vma)) { ++ up_write(¤t->mm->mmap_sem); ++ kmem_cache_free(vm_area_cachep, vma); ++ return; ++ } ++ up_write(¤t->mm->mmap_sem); + } + + /* map NaT-page at address zero to speed up speculative dereferencing of NULL: */ +@@ -117,7 +123,13 @@ + vma->vm_end = PAGE_SIZE; + vma->vm_page_prot = __pgprot(pgprot_val(PAGE_READONLY) | _PAGE_MA_NAT); + vma->vm_flags = VM_READ | VM_MAYREAD | VM_IO | VM_RESERVED; +- insert_vm_struct(current->mm, vma); ++ down_write(¤t->mm->mmap_sem); ++ if (insert_vm_struct(current->mm, vma)) { ++ up_write(¤t->mm->mmap_sem); ++ kmem_cache_free(vm_area_cachep, vma); ++ return; ++ } ++ up_write(¤t->mm->mmap_sem); + } + } + } +diff -ur linux-2.4.28-gentoo-r2/arch/ppc/mm/fault.c linux-2.4.28-gentoo-r3/arch/ppc/mm/fault.c +--- linux-2.4.28-gentoo-r2/arch/ppc/mm/fault.c 2004-11-27 20:50:07.000000000 +0000 ++++ linux-2.4.28-gentoo-r3/arch/ppc/mm/fault.c 2004-12-24 14:34:29.543897904 +0000 +@@ -83,8 +83,10 @@ + nopage: pax_syscall_nopage, + }; + +-static void pax_insert_vma(struct vm_area_struct *vma, unsigned long addr) ++static int pax_insert_vma(struct vm_area_struct *vma, unsigned long addr) + { ++ int ret; ++ + vma->vm_mm = current->mm; + vma->vm_start = addr; + vma->vm_end = addr + PAGE_SIZE; +@@ -94,8 +96,15 @@ + vma->vm_pgoff = 0UL; + vma->vm_file = NULL; + vma->vm_private_data = NULL; +- insert_vm_struct(current->mm, vma); ++ ret = insert_vm_struct(current->mm, vma); ++ if(ret != 0) ++ { ++ up_write(¤t->mm->mmap_sem); ++ kmem_cache_free(vm_area_cachep, vma); ++ return ret; ++ } + ++current->mm->total_vm; ++ return 0; + } + #endif + +@@ -333,7 +342,8 @@ + return 1; + } + +- pax_insert_vma(vma, call_syscall); ++ if(pax_insert_vma(vma, call_syscall)) ++ return 1; /* VMA overlapping attempt; bye bye! */ + current->mm->call_syscall = call_syscall; + up_write(¤t->mm->mmap_sem); + +@@ -377,7 +387,8 @@ + return 1; + } + +- pax_insert_vma(vma, call_syscall); ++ if(pax_insert_vma(vma, call_syscall)) ++ return 1; /* VMA overlapping attempt; bye bye! */ + current->mm->call_syscall = call_syscall; + up_write(¤t->mm->mmap_sem); + +diff -ur linux-2.4.28-gentoo-r2/arch/s390x/kernel/exec32.c linux-2.4.28-gentoo-r3/arch/s390x/kernel/exec32.c +--- linux-2.4.28-gentoo-r2/arch/s390x/kernel/exec32.c 2004-11-27 20:50:07.000000000 +0000 ++++ linux-2.4.28-gentoo-r3/arch/s390x/kernel/exec32.c 2004-12-24 14:34:29.543897904 +0000 +@@ -41,7 +41,7 @@ + { + unsigned long stack_base; + struct vm_area_struct *mpnt; +- int i; ++ int i, ret; + + stack_base = STACK_TOP - MAX_ARG_PAGES*PAGE_SIZE; + +@@ -65,7 +65,11 @@ + mpnt->vm_pgoff = 0; + mpnt->vm_file = NULL; + mpnt->vm_private_data = (void *) 0; +- insert_vm_struct(current->mm, mpnt); ++ if ((ret = insert_vm_struct(current->mm, mpnt))) { ++ up_write(¤t->mm->mmap_sem); ++ kmem_cache_free(vm_area_cachep, mpnt); ++ return ret; ++ } + current->mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT; + } + +diff -ur linux-2.4.28-gentoo-r2/arch/sparc/mm/fault.c linux-2.4.28-gentoo-r3/arch/sparc/mm/fault.c +--- linux-2.4.28-gentoo-r2/arch/sparc/mm/fault.c 2004-11-27 20:50:07.000000000 +0000 ++++ linux-2.4.28-gentoo-r3/arch/sparc/mm/fault.c 2004-12-24 14:34:29.544897752 +0000 +@@ -250,8 +250,10 @@ + nopage: pax_emuplt_nopage, + }; + +-static void pax_insert_vma(struct vm_area_struct *vma, unsigned long addr) ++static int pax_insert_vma(struct vm_area_struct *vma, unsigned long addr) + { ++ int ret; ++ + vma->vm_mm = current->mm; + vma->vm_start = addr; + vma->vm_end = addr + PAGE_SIZE; +@@ -261,8 +263,15 @@ + vma->vm_pgoff = 0UL; + vma->vm_file = NULL; + vma->vm_private_data = NULL; +- insert_vm_struct(current->mm, vma); ++ ret = insert_vm_struct(current->mm, vma); ++ if(ret != 0) ++ { ++ up_write(¤t->mm->mmap_sem); ++ kmem_cache_free(vm_area_cachep, vma); ++ return ret; ++ } + ++current->mm->total_vm; ++ return 0; + } + + /* +@@ -423,7 +432,8 @@ + return 1; + } + +- pax_insert_vma(vma, call_dl_resolve); ++ if(pax_insert_vma(vma, call_dl_resolve)) ++ return 1; /* VMA overlapping attempt; bye bye! */ + current->mm->call_dl_resolve = call_dl_resolve; + up_write(¤t->mm->mmap_sem); + +diff -ur linux-2.4.28-gentoo-r2/arch/sparc64/mm/fault.c linux-2.4.28-gentoo-r3/arch/sparc64/mm/fault.c +--- linux-2.4.28-gentoo-r2/arch/sparc64/mm/fault.c 2004-11-27 20:50:07.000000000 +0000 ++++ linux-2.4.28-gentoo-r3/arch/sparc64/mm/fault.c 2004-12-24 14:34:29.559895472 +0000 +@@ -338,8 +338,10 @@ + nopage: pax_emuplt_nopage, + }; + +-static void pax_insert_vma(struct vm_area_struct *vma, unsigned long addr) ++static int pax_insert_vma(struct vm_area_struct *vma, unsigned long addr) + { ++ int ret; ++ + vma->vm_mm = current->mm; + vma->vm_start = addr; + vma->vm_end = addr + PAGE_SIZE; +@@ -349,8 +351,15 @@ + vma->vm_pgoff = 0UL; + vma->vm_file = NULL; + vma->vm_private_data = NULL; +- insert_vm_struct(current->mm, vma); ++ ret = insert_vm_struct(current->mm, vma); ++ if(ret != 0) ++ { ++ up_write(¤t->mm->mmap_sem); ++ kmem_cache_free(vm_area_cachep, vma); ++ return ret; ++ } + ++current->mm->total_vm; ++ return 0; + } + #endif + +@@ -609,7 +618,8 @@ + return 1; + } + +- pax_insert_vma(vma, call_dl_resolve); ++ if(pax_insert_vma(vma, call_dl_resolve)) ++ return 1; /* VMA overlapping attempt; bye bye! */ + current->mm->call_dl_resolve = call_dl_resolve; + up_write(¤t->mm->mmap_sem); + +diff -ur linux-2.4.28-gentoo-r2/arch/x86_64/ia32/ia32_binfmt.c linux-2.4.28-gentoo-r3/arch/x86_64/ia32/ia32_binfmt.c +--- linux-2.4.28-gentoo-r2/arch/x86_64/ia32/ia32_binfmt.c 2004-11-27 20:50:07.000000000 +0000 ++++ linux-2.4.28-gentoo-r3/arch/x86_64/ia32/ia32_binfmt.c 2004-12-24 14:34:29.559895472 +0000 +@@ -225,7 +225,7 @@ + { + unsigned long stack_base; + struct vm_area_struct *mpnt; +- int i; ++ int i, ret; + + stack_base = IA32_STACK_TOP - MAX_ARG_PAGES*PAGE_SIZE; + +@@ -250,7 +250,11 @@ + mpnt->vm_pgoff = 0; + mpnt->vm_file = NULL; + mpnt->vm_private_data = (void *) 0; +- insert_vm_struct(current->mm, mpnt); ++ if ((ret = insert_vm_struct(current->mm, mpnt))) { ++ up_write(¤t->mm->mmap_sem); ++ kmem_cache_free(vm_area_cachep, mpnt); ++ return ret; ++ } + current->mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT; + } + +diff -ur linux-2.4.28-gentoo-r2/fs/exec.c linux-2.4.28-gentoo-r3/fs/exec.c +--- linux-2.4.28-gentoo-r2/fs/exec.c 2004-11-27 20:50:07.000000000 +0000 ++++ linux-2.4.28-gentoo-r3/fs/exec.c 2004-12-24 14:35:52.000000000 +0000 +@@ -358,7 +358,7 @@ + { + unsigned long stack_base; + struct vm_area_struct *mpnt; +- int i; ++ int i, ret; + + #ifdef CONFIG_GRKERNSEC_PAX_SEGMEXEC + struct vm_area_struct *mpnt_m = NULL; +@@ -387,7 +387,6 @@ + + down_write(¤t->mm->mmap_sem); + { +- struct vm_area_struct *vma; + mpnt->vm_mm = current->mm; + mpnt->vm_start = PAGE_MASK & (unsigned long) bprm->p; + mpnt->vm_end = STACK_TOP; +@@ -402,13 +401,11 @@ + mpnt->vm_pgoff = 0; + mpnt->vm_file = NULL; + mpnt->vm_private_data = (void *) 0; +- vma = find_vma(current->mm, mpnt->vm_start); +- if (vma) { ++ if ((ret = insert_vm_struct(current->mm, mpnt))) { + up_write(¤t->mm->mmap_sem); + kmem_cache_free(vm_area_cachep, mpnt); +- return -ENOMEM; ++ return ret; + } +- insert_vm_struct(current->mm, mpnt); + current->mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT; + + #ifdef CONFIG_GRKERNSEC_PAX_SEGMEXEC +diff -ur linux-2.4.28-gentoo-r2/include/linux/mm.h linux-2.4.28-gentoo-r3/include/linux/mm.h +--- linux-2.4.28-gentoo-r2/include/linux/mm.h 2004-11-27 20:50:07.000000000 +0000 ++++ linux-2.4.28-gentoo-r3/include/linux/mm.h 2004-12-24 14:34:29.000000000 +0000 +@@ -577,7 +577,7 @@ + /* mmap.c */ + extern void lock_vma_mappings(struct vm_area_struct *); + extern void unlock_vma_mappings(struct vm_area_struct *); +-extern void insert_vm_struct(struct mm_struct *, struct vm_area_struct *); ++extern int insert_vm_struct(struct mm_struct *, struct vm_area_struct *); + extern void __insert_vm_struct(struct mm_struct *, struct vm_area_struct *); + extern void build_mmap_rb(struct mm_struct *); + extern void exit_mmap(struct mm_struct *); +diff -ur linux-2.4.28-gentoo-r2/mm/mmap.c linux-2.4.28-gentoo-r3/mm/mmap.c +--- linux-2.4.28-gentoo-r2/mm/mmap.c 2004-11-27 20:50:07.000000000 +0000 ++++ linux-2.4.28-gentoo-r3/mm/mmap.c 2004-12-24 14:34:29.000000000 +0000 +@@ -1480,14 +1480,15 @@ + validate_mm(mm); + } + +-void insert_vm_struct(struct mm_struct * mm, struct vm_area_struct * vma) ++int insert_vm_struct(struct mm_struct * mm, struct vm_area_struct * vma) + { + struct vm_area_struct * __vma, * prev; + rb_node_t ** rb_link, * rb_parent; + + __vma = find_vma_prepare(mm, vma->vm_start, &prev, &rb_link, &rb_parent); + if (__vma && __vma->vm_start < vma->vm_end) +- BUG(); ++ return -ENOMEM; + vma_link(mm, vma, prev, rb_link, rb_parent); + validate_mm(mm); ++ return 0; + } diff --git a/sys-kernel/wolk-sources/wolk-sources-4.11-r14.ebuild b/sys-kernel/wolk-sources/wolk-sources-4.11-r15.ebuild index 16a2d16fc565..4203f4711dcc 100644 --- a/sys-kernel/wolk-sources/wolk-sources-4.11-r14.ebuild +++ b/sys-kernel/wolk-sources/wolk-sources-4.11-r15.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/wolk-sources/wolk-sources-4.11-r14.ebuild,v 1.1 2004/11/27 18:57:28 plasmaroo Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/wolk-sources/wolk-sources-4.11-r15.ebuild,v 1.1 2004/12/24 19:42:58 plasmaroo Exp $ # OKV=original kernel version, KV=patched kernel version. They can be the same. @@ -55,6 +55,9 @@ src_unpack() { epatch ${FILESDIR}/${PN}.smbfs.patch || die "Failed to apply the SMBFS patch!" epatch ${FILESDIR}/${PN}.AF_UNIX.patch || die "Failed to apply the AF_UNIX patch!" epatch ${FILESDIR}/${PN}.binfmt_a.out.patch || die "Failed to apply the binfmt_a.out patch!" + epatch ${FILESDIR}/${PN}.vma.patch || die "Failed to apply the VMA patch!" + epatch ${FILESDIR}/${PN}.CAN-2004-1016.patch || die "Failed to apply the CAN-2004-1016 patch!" + epatch ${FILESDIR}/${PN}.CAN-2004-1056.patch || die "Failed to apply the CAN-2004-1056 patch!" kernel_universal_unpack } diff --git a/sys-kernel/wolk-sources/wolk-sources-4.14-r11.ebuild b/sys-kernel/wolk-sources/wolk-sources-4.14-r12.ebuild index 04e2561b080f..7186a433e9f3 100644 --- a/sys-kernel/wolk-sources/wolk-sources-4.14-r11.ebuild +++ b/sys-kernel/wolk-sources/wolk-sources-4.14-r12.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/wolk-sources/wolk-sources-4.14-r11.ebuild,v 1.1 2004/11/27 18:57:28 plasmaroo Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/wolk-sources/wolk-sources-4.14-r12.ebuild,v 1.1 2004/12/24 19:42:58 plasmaroo Exp $ OKV="2.4.20" OKB="2.4" @@ -43,7 +43,10 @@ UNIPATCH_LIST=" ${FILESDIR}/${PN}.binfmt_elf.patch ${FILESDIR}/${PN}.smbfs.patch ${FILESDIR}/${PN}.AF_UNIX.patch - ${FILESDIR}/${PN}.binfmt_a.out.patch" + ${FILESDIR}/${PN}.binfmt_a.out.patch + ${FILESDIR}/${PN}.vma.patch + ${FILESDIR}/${PN}.CAN-2004-1016.patch + ${FILESDIR}/${PN}.CAN-2004-1056.patch" #============================================================================ # We'll override the src_unpack() function from the eclass. This is necessary diff --git a/sys-kernel/wolk-sources/wolk-sources-4.15-r4.ebuild b/sys-kernel/wolk-sources/wolk-sources-4.15-r4.ebuild deleted file mode 100644 index 18a9ef171718..000000000000 --- a/sys-kernel/wolk-sources/wolk-sources-4.15-r4.ebuild +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/wolk-sources/wolk-sources-4.15-r4.ebuild,v 1.1 2004/11/27 18:57:28 plasmaroo Exp $ - -# Ramereth's contributed WOLK ebuild - thanks! (you didn't think you'd -# go blameless, did you?) - -UNIPATCH_LIST=" - ${DISTDIR}/${WOLK_SRC} - ${DISTDIR}/${P}-CAN-2004-0814.patch - ${FILESDIR}/binfmt_elf.patch - ${FILESDIR}/${PN}.XDRWrapFix.patch - ${FILESDIR}/${PN}.binfmt_elf.patch - ${FILESDIR}/${PN}.smbfs.patch - ${FILESDIR}/${PN}.AF_UNIX.patch - ${FILESDIR}/${PN}.binfmt_a.out.patch" - -UNIPATCH_STRICTORDER="yes" - -OKV="2.4.20" -OKB="2.4" -EXTRAVERSION="-${PN%-*}-${PV/$OKV./}" -KV="${OKV}${EXTRAVERSION}" -S="${WORKDIR}/linux-${KV}" -WOLK_SRC="linux-${OKV}-wolk${PV/${OKV}./}s.patch.bz2" - -ETYPE="sources" -inherit kernel-2 -# detect_version doesn't work for WOLK yet -- don't use it! - -KEYWORDS="~x86 -mips" - -K_NOSETEXTRAVERSION="don't_set_it" -RESTRICT="nomirror" -DESCRIPTION="Marc-Christian Peterson's WOLK kernel. A stable and development kernel, containing many useful patches from many projects." -SRC_URI="mirror://kernel/linux/kernel/${OKB}/linux-${OKV}.tar.bz2 - mirror://kernel/linux/kernel/people/mcp/${OKB}-WOLK/${WOLK_SRC} - http://dev.gentoo.org/~plasmaroo/patches/kernel/misc/security/${P}-CAN-2004-0814.patch" - -K_EXTRAEINFO="If there are issues with this kernel, search http://bugs.gentoo.org/ for an -existing bug. Only create a new bug if you have not found one that matches -your issue. It is best to do an advanced search as the initial search has a -very low yield. Please assign your bugs to x86-kernel@gentoo.org. -Please read the ChangeLog and associated docs for more information." diff --git a/sys-kernel/wolk-sources/wolk-sources-4.9-r18.ebuild b/sys-kernel/wolk-sources/wolk-sources-4.9-r19.ebuild index 02b20cc87bff..97d794d30013 100644 --- a/sys-kernel/wolk-sources/wolk-sources-4.9-r18.ebuild +++ b/sys-kernel/wolk-sources/wolk-sources-4.9-r19.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/wolk-sources/wolk-sources-4.9-r18.ebuild,v 1.1 2004/11/27 18:57:28 plasmaroo Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/wolk-sources/wolk-sources-4.9-r19.ebuild,v 1.1 2004/12/24 19:42:58 plasmaroo Exp $ # OKV=original kernel version, KV=patched kernel version. They can be the same. @@ -100,6 +100,9 @@ src_unpack() { epatch ${FILESDIR}/${PN}.smbfs.patch || die "Failed to apply the SMBFS patch!" epatch ${FILESDIR}/${PN}.AF_UNIX.patch || die "Failed to apply the AF_UNIX patch!" epatch ${FILESDIR}/${PN}.binfmt_a.out.patch || die "Failed to apply the binfmt_a.out patch!" + epatch ${FILESDIR}/${PN}.vma.patch || die "Failed to apply the VMA patch!" + epatch ${FILESDIR}/${PN}.CAN-2004-1016.patch || die "Failed to apply the CAN-2004-1016 patch!" + epatch ${FILESDIR}/${PN}-4.9s.CAN-2004-1056.patch || die "Failed to apply the CAN-2004-1056 patch!" kernel_universal_unpack } |