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:	Fri, 27 Feb 2015 20:17:37 +0900
From:	Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
To:	He Kuang <hekuang@...wei.com>
Cc:	acme@...nel.org, mingo@...hat.com, wangnan0@...wei.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf: Fix a precedence bug

(2015/02/27 19:52), He Kuang wrote:
> The minus operator has higher precedence than ?:
> Add parentheses around ?: fix this.
> 
> Before this patch:
> $ echo 'p:myprobe do_sys_open' > /sys/kernel/debug/tracing/kprobe_events
> $ perf probe -l -k ../vmlinux
>   kprobes:myprobe      (on do_sys_open)
> 
> After this patch:
> $ echo 'p:myprobe do_sys_open' > /sys/kernel/debug/tracing/kprobe_events
> $ perf probe -l -k ../vmlinux
>   kprobes:myprobe      (on do_sys_open@...ux.git/fs/open.c)


BTW, on my environment (CentOS7)

# ./perf probe -a do_fork
Added new event:
  probe:do_fork        (on do_fork)

You can now use it in all perf tools, such as:

        perf record -e probe:do_fork -aR sleep 1

# ./perf probe -l
  probe:do_fork        (on do_fork@...nel/fork.c)

# ./perf probe -l -k /usr/lib/debug/lib/modules/3.10.0-123.13.2.el7.x86_64/vmlinux
  probe:do_fork        (on do_fork@...nel/fork.c)

Hm, the current perf (without this patch) seems work...
But anyway, it looks safer to brace it.

Thank you,


> 
> Signed-off-by: He Kuang <hekuang@...wei.com>
> ---
>  tools/perf/util/probe-event.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
> index 919937e..bed8d0f 100644
> --- a/tools/perf/util/probe-event.c
> +++ b/tools/perf/util/probe-event.c
> @@ -150,7 +150,7 @@ static u64 kernel_get_symbol_address_by_name(const char *name, bool reloc)
>  		sym = __find_kernel_function_by_name(name, &map);
>  		if (sym)
>  			return map->unmap_ip(map, sym->start) -
> -				(reloc) ? 0 : map->reloc;
> +				((reloc) ? 0 : map->reloc);
>  	}
>  	return 0;
>  }
> 


-- 
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@...achi.com


--
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