diff --git a/ipc/shm.c b/ipc/shm.c
index 4fefbad7096d539d90345621ac6419d2ab904b85..02faa54dbf5a2369cbd01ed464bfa3fcea686cad 100644
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -397,6 +397,11 @@ static int newseg (struct ipc_namespace *ns, key_t key, int shmflg, size_t size)
 	shp->shm_nattch = 0;
 	shp->id = shm_buildid(ns, id, shp->shm_perm.seq);
 	shp->shm_file = file;
+	/*
+	 * shmid gets reported as "inode#" in /proc/pid/maps.
+	 * proc-ps tools use this. Changing this will break them.
+	 */
+	file->f_dentry->d_inode->i_ino = shp->id;
 
 	ns->shm_tot += numpages;
 	shm_unlock(shp);