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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 12 Jan 2012 22:49:20 +0200
From:	Daniel Baluta <dbaluta@...acom.com>
To:	Sorin Dumitru <dumitru.sorin87@...il.com>
Cc:	linux-kernel@...r.kernel.org, a.p.zijlstra@...llo.nl,
	acme@...stprotocols.net
Subject: Re: [PATCH] perf: check if address is in range

On Thu, Jan 12, 2012 at 10:39 PM, Sorin Dumitru
<dumitru.sorin87@...il.com> wrote:
> When addr isn't in the [sym->start,sym->end] range offset
> will be a very big value, giving us a segfault when we do:
>        h->addr[offset]++
> Fix this by checking that addr is in the correct range.
>
> Signed-off-by: Sorin Dumitru <dumitru.sorin87@...il.com>
> ---
>  tools/perf/util/annotate.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
> index 011ed26..4ddc55f 100644
> --- a/tools/perf/util/annotate.c
> +++ b/tools/perf/util/annotate.c
> @@ -64,7 +64,7 @@ int symbol__inc_addr_samples(struct symbol *sym, struct map *map,
>
>        pr_debug3("%s: addr=%#" PRIx64 "\n", __func__, map->unmap_ip(map, addr));
>
> -       if (addr >= sym->end)
> +       if (addr <= sym->start || addr >= sym->end)
>                return 0;

Shouldn't this be addr < sym->start ?

thanks,
Daniel.
--
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