Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1175817

[PATCH 6/6] kdbus: fix NULL-deref in activator cleanup

From David Herrmann <dh.herrmann@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 6/6] kdbus: fix NULL-deref in activator cleanup
Date 2015-07-02 10:40 +0200
Message-ID <pHIci-jZ-9@gated-at.bofh.it> (permalink)
References <pHI2C-gz-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] Miscellaneous kdbus fixes and code removal David Herrmann <dh.herrmann@gmail.com> - 2015-07-02 10:30 +0200
  [PATCH 3/6] kdbus: drop unused 'bloom_generation' field David Herrmann <dh.herrmann@gmail.com> - 2015-07-02 10:30 +0200
  [PATCH 4/6] kdbus: drop support for required attach-flags on buses David Herrmann <dh.herrmann@gmail.com> - 2015-07-02 10:30 +0200
  [PATCH 5/6] kdbus: pin namespaces on HELLO David Herrmann <dh.herrmann@gmail.com> - 2015-07-02 10:40 +0200
    Re: [PATCH 5/6] kdbus: pin namespaces on HELLO David Herrmann <dh.herrmann@gmail.com> - 2015-07-05 11:10 +0200
  [PATCH 6/6] kdbus: fix NULL-deref in activator cleanup David Herrmann <dh.herrmann@gmail.com> - 2015-07-02 10:40 +0200
  [PATCH 2/6] kdbus: drop redundant KDBUS_MSG_MAX_ITEMS David Herrmann <dh.herrmann@gmail.com> - 2015-07-02 10:40 +0200
    [PATCH v2 2/6] kdbus: drop redundant KDBUS_MSG_MAX_ITEMS David Herrmann <dh.herrmann@gmail.com> - 2015-07-05 10:40 +0200

csiph-web