summaryrefslogtreecommitdiff
path: root/fs/ocfs2
diff options
context:
space:
mode:
authordann frazier <dann.frazier@canonical.com>2010-11-18 15:03:09 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2011-03-21 12:45:04 -0700
commit2bc3c404decf406bfadd88001945bc2673fc6e4f (patch)
tree928722b3ab9101f7aa9b8ad7485b47b036b8bd1f /fs/ocfs2
parent57c247a86588c5602e26367728be7fd61d3b334a (diff)
downloadlwn-2bc3c404decf406bfadd88001945bc2673fc6e4f.tar.gz
lwn-2bc3c404decf406bfadd88001945bc2673fc6e4f.zip
ocfs2_connection_find() returns pointer to bad structure
commit 226291aa4641fa13cb5dec3bcb3379faa83009e2 upstream. If ocfs2_live_connection_list is empty, ocfs2_connection_find() will return a pointer to the LIST_HEAD, cast as a ocfs2_live_connection. This can cause an oops when ocfs2_control_send_down() dereferences c->oc_conn: Call Trace: [<ffffffffa00c2a3c>] ocfs2_control_message+0x28c/0x2b0 [ocfs2_stack_user] [<ffffffffa00c2a95>] ocfs2_control_write+0x35/0xb0 [ocfs2_stack_user] [<ffffffff81143a88>] vfs_write+0xb8/0x1a0 [<ffffffff8155cc13>] ? do_page_fault+0x153/0x3b0 [<ffffffff811442f1>] sys_write+0x51/0x80 [<ffffffff810121b2>] system_call_fastpath+0x16/0x1b Fix by explicitly returning NULL if no match is found. Signed-off-by: dann frazier <dann.frazier@canonical.com> Signed-off-by: Joel Becker <joel.becker@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/stack_user.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c
index da78a2a334fd..197249ef2e43 100644
--- a/fs/ocfs2/stack_user.c
+++ b/fs/ocfs2/stack_user.c
@@ -191,7 +191,7 @@ static struct ocfs2_live_connection *ocfs2_connection_find(const char *name)
return c;
}
- return c;
+ return NULL;
}
/*