Skip to contentSkip to conversation

ipc-shmc-check-for-overflows-of-shm_tot.patch removed from -mm tree

merged [email protected] 1 participant 1 message Jun 9, 2014

lore
Share & tools
lore
#0 lore raw

Subject: [merged] ipc-shmc-check-for-overflows-of-shm_tot.patch removed from -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Mon, 09 Jun 2014 12:37:17 -0700

The patch titled
Subject: ipc/shm.c: check for overflows of shm_tot
has been removed from the -mm tree. Its filename was
ipc-shmc-check-for-overflows-of-shm_tot.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Manfred Spraul <[email protected]>
Subject: ipc/shm.c: check for overflows of shm_tot

shm_tot counts the total number of pages used by shm segments.

If SHMALL is ULONG_MAX (or nearly ULONG_MAX), then the number can overflow. Subsequent calls to shmctl(,SHM_INFO,) would return wrong values for shm_tot.

The patch adds a detection for overflows.

---

 ipc/shm.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
ipc/shm.c renamed from ipc/shm.c~ipc-shmc-check-for-overflows-of-shm_tot +2 -1
diff -puN ipc/shm.c~ipc-shmc-check-for-overflows-of-shm_tot ipc/shm.c
@@ -493,7 +493,8 @@ static int newseg(struct ipc_namespace *
 	if (size < SHMMIN || size > ns->shm_ctlmax)
 		return -EINVAL;
 
-	if (ns->shm_tot + numpages > ns->shm_ctlall)
+	if (ns->shm_tot + numpages < ns->shm_tot ||
+			ns->shm_tot + numpages > ns->shm_ctlall)
 		return -ENOSPC;
 
 	shp = ipc_rcu_alloc(sizeof(*shp));

_

Patches currently in -mm which might be from [email protected] are

origin.patch
slab-leaks3-default-y.patch