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]
Message-ID: <20200626153910.7b3d7e16@oasis.local.home>
Date:   Fri, 26 Jun 2020 15:39:10 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Cc:     linux-kernel <linux-kernel@...r.kernel.org>,
        Ingo Molnar <mingo@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Arnaldo Carvalho de Melo <acme@...hat.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        Yordan Karadzhov <y.karadz@...il.com>,
        Tzvetomir Stoyanov <tz.stoyanov@...il.com>,
        Tom Zanussi <zanussi@...nel.org>,
        Jason Behmer <jbehmer@...gle.com>,
        Julia Lawall <julia.lawall@...ia.fr>,
        Clark Williams <williams@...hat.com>,
        bristot <bristot@...hat.com>, Daniel Wagner <wagi@...om.org>,
        Darren Hart <dvhart@...are.com>,
        Jonathan Corbet <corbet@....net>,
        "Suresh E. Warrier" <warrier@...ux.vnet.ibm.com>
Subject: Re: [RFC][PATCH] ring-buffer: Have nested events still record
 running time stamp

On Fri, 26 Jun 2020 14:58:19 -0400
Steven Rostedt <rostedt@...dmis.org> wrote:

> Second usage:
> 
> 		/* SLOW PATH - Interrupted between A and C */
> 		a_ok = rb_time_read(&cpu_buffer->write_stamp, &after);
> 		ts = rb_time_stamp(cpu_buffer->buffer);
> 		barrier();
>  /*E*/		if (write == (local_read(&tail_page->write) & RB_WRITE_MASK) &&
> 		    a_ok && after < ts) {
> 			/* Nothing came after this event between C and E */
> 			info->delta = ts - after;
> 			(void)rb_time_cmpxchg(&cpu_buffer->write_stamp, after, info->ts);
> 			info->ts = ts;
> 		} else {
> 			info->delta = 0;

Actually, I don't think a_ok can every be false here. An uninterrupted
event will leave with both before_stamp and write_stamp valid. As an
uninterrupted event will write to both (and a rb_time_t is only invalid
from reading an interrupted event).

To get to this path we have:

	w = local_read(write_tail);

	<--- Interrupt event (makes write_stamp valid!)

	write = local_add_return(write_tail, length);

	w != write - length;


	[..]

	a_ok = rb_time_read(write_stamp);

Must always be valid!

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ