All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [OCFS2] ocfs2_connection_find() returns pointer to bad structure
@ 2010-11-18 22:03 ` dann frazier
  0 siblings, 0 replies; 4+ messages in thread
From: dann frazier @ 2010-11-18 22:03 UTC (permalink / raw)
  To: ocfs2-devel; +Cc: linux-kernel

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>
---
 fs/ocfs2/stack_user.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c
index 252e7c8..a5ebe42 100644
--- a/fs/ocfs2/stack_user.c
+++ b/fs/ocfs2/stack_user.c
@@ -190,7 +190,7 @@ static struct ocfs2_live_connection *ocfs2_connection_find(const char *name)
 			return c;
 	}
 
-	return c;
+	return NULL;
 }
 
 /*
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Ocfs2-devel] [PATCH] [OCFS2] ocfs2_connection_find() returns pointer to bad structure
@ 2010-11-18 22:03 ` dann frazier
  0 siblings, 0 replies; 4+ messages in thread
From: dann frazier @ 2010-11-18 22:03 UTC (permalink / raw)
  To: ocfs2-devel; +Cc: linux-kernel

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>
---
 fs/ocfs2/stack_user.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c
index 252e7c8..a5ebe42 100644
--- a/fs/ocfs2/stack_user.c
+++ b/fs/ocfs2/stack_user.c
@@ -190,7 +190,7 @@ static struct ocfs2_live_connection *ocfs2_connection_find(const char *name)
 			return c;
 	}
 
-	return c;
+	return NULL;
 }
 
 /*
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Ocfs2-devel] [PATCH] [OCFS2] ocfs2_connection_find() returns pointer to bad structure
  2010-11-18 22:03 ` [Ocfs2-devel] " dann frazier
@ 2010-11-18 23:45   ` Joel Becker
  -1 siblings, 0 replies; 4+ messages in thread
From: Joel Becker @ 2010-11-18 23:45 UTC (permalink / raw)
  To: dann frazier; +Cc: ocfs2-devel, linux-kernel

On Thu, Nov 18, 2010 at 03:03:09PM -0700, dann frazier wrote:
> 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>

	This patch is now in the fixes branch of ocfs2.git.

Joel

-- 

"I don't even butter my bread; I consider that cooking."
         - Katherine Cebrian

Joel Becker
Senior Development Manager
Oracle
E-mail: joel.becker@oracle.com
Phone: (650) 506-8127

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Ocfs2-devel] [PATCH] [OCFS2] ocfs2_connection_find() returns pointer to bad structure
@ 2010-11-18 23:45   ` Joel Becker
  0 siblings, 0 replies; 4+ messages in thread
From: Joel Becker @ 2010-11-18 23:45 UTC (permalink / raw)
  To: dann frazier; +Cc: ocfs2-devel, linux-kernel

On Thu, Nov 18, 2010 at 03:03:09PM -0700, dann frazier wrote:
> 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>

	This patch is now in the fixes branch of ocfs2.git.

Joel

-- 

"I don't even butter my bread; I consider that cooking."
         - Katherine Cebrian

Joel Becker
Senior Development Manager
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-11-18 23:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-18 22:03 [PATCH] [OCFS2] ocfs2_connection_find() returns pointer to bad structure dann frazier
2010-11-18 22:03 ` [Ocfs2-devel] " dann frazier
2010-11-18 23:45 ` Joel Becker
2010-11-18 23:45   ` Joel Becker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.