From: Tony Battersby Date: Wed, 4 Feb 2009 23:12:04 +0000 (-0800) Subject: shm: fix shmctl(SHM_INFO) lockup with !CONFIG_SHMEM X-Git-Tag: v2.6.27.16~44 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2bba098bf6965d597db52ba6e377413b4cc24086;p=pandora-kernel.git shm: fix shmctl(SHM_INFO) lockup with !CONFIG_SHMEM commit a68e61e8ff2d46327a37b69056998b47745db6fa upstream. shm_get_stat() assumes that the inode is a "struct shmem_inode_info", which is incorrect for !CONFIG_SHMEM (see fs/ramfs/inode.c: ramfs_get_inode() vs. mm/shmem.c: shmem_get_inode()). This bad assumption can cause shmctl(SHM_INFO) to lockup when shm_get_stat() tries to spin_lock(&info->lock). Users of !CONFIG_SHMEM may encounter this lockup simply by invoking the 'ipcs' command. Reported by Jiri Olsa back in February 2008: http://lkml.org/lkml/2008/2/29/74 Signed-off-by: Tony Battersby Cc: Jiri Kosina Reported-by: Jiri Olsa Cc: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed