* [lttng-dev] [PATCH lttng-tools] Fix: Don't dispatch uninitialized hash tables to the ht_cleanup thread
@ 2013-11-11 19:43 Jérémie Galarneau
2013-11-11 20:30 ` [lttng-dev] [PATCH lttng-tools v2] " Jérémie Galarneau
0 siblings, 1 reply; 3+ messages in thread
From: Jérémie Galarneau @ 2013-11-11 19:43 UTC (permalink / raw)
Some error-handling code paths may call ht_cleanup_push() with NULL hash
tables which will crash the clean-up thread.
Signed-off-by: J?r?mie Galarneau <jeremie.galarneau at efficios.com>
---
src/bin/lttng-sessiond/utils.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/bin/lttng-sessiond/utils.c b/src/bin/lttng-sessiond/utils.c
index 85a1f02..5efa1d4 100644
--- a/src/bin/lttng-sessiond/utils.c
+++ b/src/bin/lttng-sessiond/utils.c
@@ -54,6 +54,9 @@ void ht_cleanup_push(struct lttng_ht *ht)
int ret;
int fd = ht_cleanup_pipe[1];
+ if (!ht) {
+ return;
+ }
if (fd < 0)
return;
do {
--
1.8.4.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* [lttng-dev] [PATCH lttng-tools v2] Fix: Don't dispatch uninitialized hash tables to the ht_cleanup thread
2013-11-11 19:43 [lttng-dev] [PATCH lttng-tools] Fix: Don't dispatch uninitialized hash tables to the ht_cleanup thread Jérémie Galarneau
@ 2013-11-11 20:30 ` Jérémie Galarneau
2013-11-11 20:45 ` David Goulet
0 siblings, 1 reply; 3+ messages in thread
From: Jérémie Galarneau @ 2013-11-11 20:30 UTC (permalink / raw)
Some error-handling code paths may call ht_cleanup_push() with NULL hash
tables which will crash the clean-up thread.
Signed-off-by: J?r?mie Galarneau <jeremie.galarneau at efficios.com>
---
src/bin/lttng-sessiond/utils.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/bin/lttng-sessiond/utils.c b/src/bin/lttng-sessiond/utils.c
index 2ff57cd..c9c51ed 100644
--- a/src/bin/lttng-sessiond/utils.c
+++ b/src/bin/lttng-sessiond/utils.c
@@ -52,6 +52,9 @@ void ht_cleanup_push(struct lttng_ht *ht)
ssize_t ret;
int fd = ht_cleanup_pipe[1];
+ if (!ht) {
+ return;
+ }
if (fd < 0)
return;
ret = lttng_write(fd, &ht, sizeof(ht));
--
1.8.4.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* [lttng-dev] [PATCH lttng-tools v2] Fix: Don't dispatch uninitialized hash tables to the ht_cleanup thread
2013-11-11 20:30 ` [lttng-dev] [PATCH lttng-tools v2] " Jérémie Galarneau
@ 2013-11-11 20:45 ` David Goulet
0 siblings, 0 replies; 3+ messages in thread
From: David Goulet @ 2013-11-11 20:45 UTC (permalink / raw)
Merged!
On 11 Nov (15:30:08), J?r?mie Galarneau wrote:
> Some error-handling code paths may call ht_cleanup_push() with NULL hash
> tables which will crash the clean-up thread.
>
> Signed-off-by: J?r?mie Galarneau <jeremie.galarneau at efficios.com>
> ---
> src/bin/lttng-sessiond/utils.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/src/bin/lttng-sessiond/utils.c b/src/bin/lttng-sessiond/utils.c
> index 2ff57cd..c9c51ed 100644
> --- a/src/bin/lttng-sessiond/utils.c
> +++ b/src/bin/lttng-sessiond/utils.c
> @@ -52,6 +52,9 @@ void ht_cleanup_push(struct lttng_ht *ht)
> ssize_t ret;
> int fd = ht_cleanup_pipe[1];
>
> + if (!ht) {
> + return;
> + }
> if (fd < 0)
> return;
> ret = lttng_write(fd, &ht, sizeof(ht));
> --
> 1.8.4.2
>
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: Digital signature
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20131111/8c029642/attachment.pgp>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-11-11 20:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-11 19:43 [lttng-dev] [PATCH lttng-tools] Fix: Don't dispatch uninitialized hash tables to the ht_cleanup thread Jérémie Galarneau
2013-11-11 20:30 ` [lttng-dev] [PATCH lttng-tools v2] " Jérémie Galarneau
2013-11-11 20:45 ` David Goulet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox