]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commit
ocfs2: fix NULL pointer dereference in ocfs2_duplicate_clusters_by_page
authorTiger Yang <tiger.yang@oracle.com>
Tue, 13 Aug 2013 23:00:58 +0000 (16:00 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 14 Aug 2013 00:57:49 +0000 (17:57 -0700)
commitc7dd3392ad469e6ba125170ad29f881bed85b678
treebdb444e27e72975da0a3ebad279392fb8b81929d
parent6115ea288424c1ead077843b6cd22369dd2e08f9
ocfs2: fix NULL pointer dereference in ocfs2_duplicate_clusters_by_page

Since ocfs2_cow_file_pos will invoke ocfs2_refcount_icow with a NULL as
the struct file pointer, it finally result in a null pointer dereference
in ocfs2_duplicate_clusters_by_page.

This patch replace file pointer with inode pointer in
cow_duplicate_clusters to fix this issue.

[jeff.liu@oracle.com: rebased patch against linux-next tree]
Signed-off-by: Tiger Yang <tiger.yang@oracle.com>
Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Mark Fasheh <mfasheh@suse.com>
Acked-by: Tao Ma <tm@tao.ma>
Tested-by: David Weber <wb@munzinger.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/ocfs2/aops.c
fs/ocfs2/file.c
fs/ocfs2/move_extents.c
fs/ocfs2/refcounttree.c
fs/ocfs2/refcounttree.h