lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 19 Oct 2011 15:39:30 -0600
From:	David Ahern <dsahern@...il.com>
To:	Arnaldo Carvalho de Melo <acme@...stprotocols.net>
CC:	linux-kernel@...r.kernel.org, mingo@...e.hu, peterz@...radead.org,
	fweisbec@...il.com
Subject: Re: [PATCH] perf top: fix crash on annotate request



On 10/19/2011 01:20 PM, Arnaldo Carvalho de Melo wrote:
> Can you check if that is the problem? I.e. take notes->lock, check if
> ->src is NULL, if so call symbol__alloc_hist, etc?
> 

Reproduced it on a lab box. This fixes the segfault:

diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index bc8f477..6bd501a 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -253,6 +253,17 @@ static int symbol__parse_objdump_line(struct symbol
*sym, struct map *map,
        free(line);
        return -1;
    }
+
+   pthread_mutex_lock(&notes->lock);
+   if (notes->src == NULL &&
+       symbol__alloc_hist(sym, 1) < 0) {
+       pthread_mutex_unlock(&notes->lock);
+       ui__warning("Not enough memory for annotating '%s' symbol!\n",
+               sym->name);
+       return -1;
+   }
+   pthread_mutex_unlock(&notes->lock);
+
    objdump__add_line(&notes->src->source, objdump_line);

    return 0;

Should I plumb nr_events down versus assuming its 1?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ