lkml.org 
[lkml]   [2015]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 6/6] kdbus: fix NULL-deref in activator cleanup
Date
Right now, we always assume an activator has a valid name and
conn->activator_of is set. However, this assumption is not true if the
setup of the activator fails. In those cases, the ->flags field indicates
an activator, but the name might not have been claimed, yet.

Fix the destructor of connections to not assume all activators have
claimed names.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
---
ipc/kdbus/names.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipc/kdbus/names.c b/ipc/kdbus/names.c
index d77ee08..057f806 100644
--- a/ipc/kdbus/names.c
+++ b/ipc/kdbus/names.c
@@ -444,7 +444,7 @@ void kdbus_name_release_all(struct kdbus_name_registry *reg,

down_write(&reg->rwlock);

- if (kdbus_conn_is_activator(conn)) {
+ if (conn->activator_of) {
activator = conn->activator_of->activator;
conn->activator_of->activator = NULL;
}
--
2.4.5


\
 
 \ /
  Last update: 2015-07-02 10:41    [W:0.088 / U:0.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site