r1308 - in trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian: . patches
Christoph Hellwig
hch-guest@haydn.debian.org
Wed, 25 Aug 2004 04:42:10 -0600
Author: hch-guest
Date: 2004-08-25 04:42:00 -0600 (Wed, 25 Aug 2004)
New Revision: 1308
Added:
trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/shm-segment-count-fix.dpatch
Modified:
trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/changelog
Log:
* Fix SHM segment count limit off by one (Christoph Hellwig)
Modified: trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/changelog
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/changelog 2004-08-25 10:29:06 UTC (rev 1307)
+++ trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/changelog 2004-08-25 10:42:00 UTC (rev 1308)
@@ -39,6 +39,8 @@
* Fix nfsd to not errornously return ESTALE on failed permission check
(closes: #255931) (Christoph Hellwig).
+ * Fix SHM segment count limit off by one (Christoph Hellwig)
+
-- Andres Salomon <dilinger@voxel.net> Wed, 18 Aug 2004 02:13:56 -0400
kernel-source-2.6.8 (2.6.8-2) unstable; urgency=high
Added: trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/shm-segment-count-fix.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/shm-segment-count-fix.dpatch 2004-08-25 10:29:06 UTC (rev 1307)
+++ trunk/kernel/source/kernel-source-2.6.8-2.6.8/debian/patches/shm-segment-count-fix.dpatch 2004-08-25 10:42:00 UTC (rev 1308)
@@ -0,0 +1,45 @@
+#! /bin/sh -e
+## <PATCHNAME>.dpatch by <PATCH_AUTHOR@EMAI>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Description: fix off by one in shm segment count limit
+## DP: Patch author: Manfred Spraul <manfred@colorfullife.com>
+## DP: Upstream status: backport
+
+. $(dirname $0)/DPATCH
+
+@DPATCH@
+# This is a BitKeeper generated diff -Nru style patch.
+#
+# ChangeSet
+# 2004/08/24 11:27:43-07:00 manfred@colorfullife.com
+# [PATCH] remove magic +1 from shm segment count
+#
+# Michael Kerrisk found a bug in the shm accounting code: sysv shm allows to
+# create SHMMNI+1 shared memory segments, instead of SHMMNI segments. The +1
+# is probably from the first shared anonymous mapping implementation that
+# used the sysv code to implement shared anon mappings.
+#
+# The implementation got replaced, it's now the other way around (sysv uses
+# the shared anon code), but the +1 remained.
+#
+# Signed-off-by: Manfred Spraul <manfred@colorfullife.com>
+# Signed-off-by: Andrew Morton <akpm@osdl.org>
+# Signed-off-by: Linus Torvalds <torvalds@osdl.org>
+#
+# ipc/shm.c
+# 2004/08/24 02:08:43-07:00 manfred@colorfullife.com +1 -1
+# remove magic +1 from shm segment count
+#
+diff -Nru a/ipc/shm.c b/ipc/shm.c
+--- a/ipc/shm.c 2004-08-25 12:42:03 +02:00
++++ b/ipc/shm.c 2004-08-25 12:42:03 +02:00
+@@ -78,7 +78,7 @@
+
+ static inline int shm_addid(struct shmid_kernel *shp)
+ {
+- return ipc_addid(&shm_ids, &shp->shm_perm, shm_ctlmni+1);
++ return ipc_addid(&shm_ids, &shp->shm_perm, shm_ctlmni);
+ }
+
+