linux/fs/kernfs
Tejun Heo 29b311867d kernfs: protect lazy kernfs_iattrs allocation with mutex
commit 4afddd60a7 upstream.

kernfs_iattrs is allocated lazily when operations which require it
take place; unfortunately, the lazy allocation and returning weren't
properly synchronized and when there are multiple concurrent
operations, it might end up returning kernfs_iattrs which hasn't
finished initialization yet or different copies to different callers.

Fix it by synchronizing with a mutex.  This can be smarter with memory
barriers but let's go there if it actually turns out to be necessary.

Signed-off-by: Tejun Heo <tj@kernel.org>
Link: http://lkml.kernel.org/g/533ABA32.9080602@oracle.com
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-04-26 17:19:04 -07:00
..
Makefile sysfs, kernfs: add skeletons for kernfs 2013-11-27 13:28:24 -08:00
dir.c kernfs: fix off by one error. 2014-04-26 17:19:03 -07:00
file.c kernfs: associate a new kernfs_node with its parent on creation 2014-01-17 11:50:07 -08:00
inode.c kernfs: protect lazy kernfs_iattrs allocation with mutex 2014-04-26 17:19:04 -07:00
kernfs-internal.h kernfs: associate a new kernfs_node with its parent on creation 2014-01-17 11:50:07 -08:00
mount.c sysfs: fix namespace refcnt leak 2014-02-25 07:37:52 -08:00
symlink.c kernfs: associate a new kernfs_node with its parent on creation 2014-01-17 11:50:07 -08:00