kernfs: fix hash calculation in kernfs_rename_ns()
authorTejun Heo <tj@kernel.org>
Mon, 10 Feb 2014 22:57:09 +0000 (17:57 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Feb 2014 00:00:19 +0000 (16:00 -0800)
commit9561a8961c708ff6ba3e71a817af0f16bdc1d885
tree6a9d3c7b3175c81dcc0a053569f1a3707bc0ddbb
parentba341d55a420ab4fdd1a53fd395fd59bd65de880
kernfs: fix hash calculation in kernfs_rename_ns()

3eef34ad7dc3 ("kernfs: implement kernfs_get_parent(),
kernfs_name/path() and friends") restructured kernfs_rename_ns() such
that new name assignment happens under kernfs_rename_lock;
unfortunately, it mistakenly passed NULL to kernfs_name_hash() to
calculate the new hash if the name hasn't changed, which can lead to
oops.

Fix it by using kn->name and kn->ns when calculating the new hash.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Dan Carpenter dan.carpenter@oracle.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/kernfs/dir.c
This page took 0.025964 seconds and 5 git commands to generate.