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

zbyniu zbyniu at pld-linux.org
Tue Jan 22 03:04:20 CET 2008


Author: zbyniu                       Date: Tue Jan 22 02:04:20 2008 GMT
Module: SOURCES                       Tag: LINUX_2_6
---- Log message:
- missing shm changes

---- Files affected:
SOURCES:
   linux-2.6-grsec-minimal.patch (1.1.2.25 -> 1.1.2.26) 

---- Diffs:

================================================================
Index: SOURCES/linux-2.6-grsec-minimal.patch
diff -u SOURCES/linux-2.6-grsec-minimal.patch:1.1.2.25 SOURCES/linux-2.6-grsec-minimal.patch:1.1.2.26
--- SOURCES/linux-2.6-grsec-minimal.patch:1.1.2.25	Tue Jan 22 00:14:46 2008
+++ SOURCES/linux-2.6-grsec-minimal.patch	Tue Jan 22 03:04:15 2008
@@ -904,7 +904,7 @@
 +			shm_destroy(ns, shp);
 +		} else
 +			shm_unlock(shp);
-+		mutex_unlock(&shm_ids(ns).mutex);
++		up_write(&shm_ids(ns).rw_mutex);
 +		return;
 +	}
 +#endif
@@ -931,7 +931,7 @@
  	size = i_size_read(path.dentry->d_inode);
  	shm_unlock(shp);
  
-@@ -1014,3 +1059,27 @@ static int sysvipc_shm_proc_show(struct 
+@@ -1014,3 +1059,28 @@ static int sysvipc_shm_proc_show(struct 
  			  shp->shm_ctim);
  }
  #endif
@@ -939,7 +939,7 @@
 +void gr_shm_exit(struct task_struct *task)
 +{
 +#ifdef CONFIG_GRKERNSEC_SHM
-+	int i;
++	int in_use, next_id;
 +	struct shmid_kernel *shp;
 +	struct ipc_namespace *ns;
 +
@@ -948,8 +948,9 @@
 +	if (!grsec_enable_shm)
 +		return;
 +
-+	for (i = 0; i <= shm_ids(ns).max_id; i++) {
-+		shp = shm_get(ns, i);
++	in_use = shm_ids(ns).in_use;
++	for (next_id = 0; next_id < in_use; next_id++) {
++		shp = idr_find(&shm_ids(ns).ipcs_idr, next_id);
 +		if (shp && (shp->shm_cprid == task->pid) &&
 +		    (shp->shm_nattch <= 0)) {
 +			shp->shm_perm.mode |= SHM_DEST;
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/linux-2.6-grsec-minimal.patch?r1=1.1.2.25&r2=1.1.2.26&f=u



More information about the pld-cvs-commit mailing list