patch-2.4.10 linux/ipc/shm.c

Next file: linux/kernel/Makefile
Previous file: linux/ipc/msg.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.9/linux/ipc/shm.c linux/ipc/shm.c
@@ -606,6 +606,11 @@
 	shp = shm_lock(shmid);
 	if(shp == NULL)
 		return -EINVAL;
+	err = shm_checkid(shp,shmid);
+	if (err) {
+		shm_unlock(shmid);
+		return err;
+	}
 	if (ipcperms(&shp->shm_perm, acc_mode)) {
 		shm_unlock(shmid);
 		return -EACCES;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)