SOURCES (LINUX_2_6): linux-2.6-grsec-minimal.patch - shm handling ...

baggins baggins at pld-linux.org
Tue Jan 2 17:58:06 CET 2007


Author: baggins                      Date: Tue Jan  2 16:58:06 2007 GMT
Module: SOURCES                       Tag: LINUX_2_6
---- Log message:
- shm handling update for 2.6.19

---- Files affected:
SOURCES:
   linux-2.6-grsec-minimal.patch (1.1.2.19 -> 1.1.2.20) 

---- Diffs:

================================================================
Index: SOURCES/linux-2.6-grsec-minimal.patch
diff -u SOURCES/linux-2.6-grsec-minimal.patch:1.1.2.19 SOURCES/linux-2.6-grsec-minimal.patch:1.1.2.20
--- SOURCES/linux-2.6-grsec-minimal.patch:1.1.2.19	Tue Jan  2 16:26:35 2007
+++ SOURCES/linux-2.6-grsec-minimal.patch	Tue Jan  2 17:58:00 2007
@@ -916,10 +916,10 @@
 +	if (grsec_enable_shm) {
 +		if (shp->shm_nattch == 0) {
 +			shp->shm_perm.mode |= SHM_DEST;
-+			shm_destroy(shp);
++			shm_destroy(ns, shp);
 +		} else
 +			shm_unlock(shp);
-+		mutex_unlock(&shm_ids.mutex);
++		mutex_unlock(&shm_ids(ns).mutex);
 +		return;
 +	}
 +#endif
@@ -948,7 +948,7 @@
  	shm_unlock(shp);
  
  	down_write(&current->mm->mmap_sem);
-@@ -946,3 +966,24 @@ static int sysvipc_shm_proc_show(struct
+@@ -1014,3 +1059,27 @@ static int sysvipc_shm_proc_show(struct 
  			  shp->shm_ctim);
  }
  #endif
@@ -958,16 +958,19 @@
 +#ifdef CONFIG_GRKERNSEC_SHM
 +	int i;
 +	struct shmid_kernel *shp;
++	struct ipc_namespace *ns;
++
++	ns = current->nsproxy->ipc_ns;
 +
 +	if (!grsec_enable_shm)
 +		return;
 +
-+	for (i = 0; i <= shm_ids.max_id; i++) {
-+		shp = shm_get(i);
++	for (i = 0; i <= shm_ids(ns).max_id; i++) {
++		shp = shm_get(ns, i);
 +		if (shp && (shp->shm_cprid == task->pid) &&
 +		    (shp->shm_nattch <= 0)) {
 +			shp->shm_perm.mode |= SHM_DEST;
-+			shm_destroy(shp);
++			shm_destroy(ns, shp);
 +		}
 +	}
 +#endif
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/linux-2.6-grsec-minimal.patch?r1=1.1.2.19&r2=1.1.2.20&f=u



More information about the pld-cvs-commit mailing list