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:   Tue, 10 Oct 2017 13:33:21 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Cheng Jian <cj.chengjian@...wei.com>
Cc:     mingo@...hat.com, acme@...nel.org,
        alexander.shishkin@...ux.intel.com, linux-kernel@...r.kernel.org,
        xiexiuqi@...wei.com, huawei.libin@...wei.com,
        Steven Rostedt <rostedt@...dmis.org>,
        Jiri Olsa <jolsa@...nel.org>
Subject: Re: [PATCH] perf/ftrace : Fix repetitious traces when specify a
 target  task

On Tue, Oct 10, 2017 at 09:19:39AM +0800, Cheng Jian wrote:
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index baa134c..5682ead 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -7988,12 +7988,16 @@ void perf_tp_event(u16 event_type, u64 count, void *record, int entry_size,
>  
>  	/* Use the given event instead of the hlist */
>  	if (event) {
> -		if (perf_tp_event_match(event, &data, regs))
> +		if (perf_tp_event_match(event, &data, regs)) {
>  			perf_swevent_event(event, count, &data, regs);
> +			goto out;
> +		}
>  	} else {
>  		hlist_for_each_entry_rcu(event, head, hlist_entry) {
> -			if (perf_tp_event_match(event, &data, regs))
> +			if (perf_tp_event_match(event, &data, regs)) {
>  				perf_swevent_event(event, count, &data, regs);
> +				goto out;
> +			}
>  		}
>  	}
>  
> @@ -8015,13 +8019,15 @@ void perf_tp_event(u16 event_type, u64 count, void *record, int entry_size,
>  				continue;
>  			if (event->attr.config != entry->type)
>  				continue;
> -			if (perf_tp_event_match(event, &data, regs))
> +			if (perf_tp_event_match(event, &data, regs)) {
>  				perf_swevent_event(event, count, &data, regs);
> +				break;
> +			}
>  		}
>  unlock:
>  		rcu_read_unlock();
>  	}
> -
> +out:
>  	perf_swevent_put_recursion_context(rctx);
>  }
>  EXPORT_SYMBOL_GPL(perf_tp_event);

No, this _cannot_ be right. The whole point of the @task argument was to
deliver the event multiple times -- maybe not to the same event, but it
needs to be delivered multiple times in some cases. Therefore this is
broken.

But now you've got me looking at 75e8387685f6, which also looks
completely insane.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ