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:	Wed, 1 Oct 2008 09:54:19 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	Pekka Paalanen <pq@....fi>, linux-kernel@...r.kernel.org,
	Thomas Gleixner <tglx@...utronix.de>,
	Peter Zijlstra <peterz@...radead.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Mathieu Desnoyers <compudj@...stal.dyndns.org>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Steven Rostedt <srostedt@...hat.com>
Subject: Re: [PATCH 6/6] ftrace: take advantage of variable length entries


* Steven Rostedt <rostedt@...dmis.org> wrote:

> > >  	struct trace_entry *entry = iter->ent;
> > > -	struct mmiotrace_map *m	= &entry->field.mmiomap;
> > > +	struct mmiotrace_map *m	= (struct mmiotrace_map *)entry;
> > 
> > This is different style than above, missing the struct
> > trace_mmiotrace_map intermediate step. Looks like a bug,
> > since struct mmiotrace_map is not the first field in
> > struct trace_mmiotrace_map.
> 
> Crap! yes this is a bug. Thanks for pointing this out.

hm, there's a significant amount of type casts, see the grep below.

The ringbuffer becoming type-opaque has exactly these kinds of dangers, 
and as i suggested a few days ago, please think about a debug mode that 
stores the record type in the trace entry and validates it on extraction 
or something like that.

That might even be a robustness feature: the tracer should not crash if 
the trace buffer gets corrupted. ftrace had that invariant before, i 
think we should try to keep as many aspects of it as possible.

	Ingo

------------->
ring_buffer.c:		page = (struct buffer_page *)virt_to_page(addr);
ring_buffer.c:	cpu_buffer->reader_page = (struct buffer_page *)virt_to_page(addr);
ring_buffer.c:static void rb_reset_cpu(struct ring_buffer_per_cpu *cpu_buffer);
ring_buffer.c:			page = (struct buffer_page *)virt_to_page(addr);
trace_boot.c:	struct trace_boot *field = (struct trace_boot *)entry;
trace.c:static DEFINE_PER_CPU(struct trace_array_cpu, global_trace_cpu);
trace.c:static DEFINE_PER_CPU(struct trace_array_cpu, max_data);
trace.c:		cont = (struct trace_field_cont *)ent;
trace.c:		struct ftrace_entry *field = (struct ftrace_entry *)entry;
trace.c:			(struct ctx_switch_entry *)entry;
trace.c:		struct special_entry *field = (struct special_entry *)entry;
trace.c:		struct stack_entry *field = (struct stack_entry *)entry;
trace.c:		struct print_entry *field = (struct print_entry *)entry;
trace.c:		struct ftrace_entry *field = (struct ftrace_entry *)entry;
trace.c:			(struct ctx_switch_entry *)entry;
trace.c:		struct special_entry *field = (struct special_entry *)entry;
trace.c:		struct stack_entry *field = (struct stack_entry *)entry;
trace.c:		struct print_entry *field = (struct print_entry *)entry;
trace.c:		struct ftrace_entry *field = (struct ftrace_entry *)entry;
trace.c:			(struct ctx_switch_entry *)entry;
trace.c:		struct special_entry *field = (struct special_entry *)entry;
trace.c:		struct print_entry *field = (struct print_entry *)entry;
trace.c:		struct ftrace_entry *field = (struct ftrace_entry *)entry;
trace.c:			(struct ctx_switch_entry *)entry;
trace.c:		struct special_entry *field = (struct special_entry *)entry;
trace.c:		struct ftrace_entry *field = (struct ftrace_entry *)entry;
trace.c:			(struct ctx_switch_entry *)entry;
trace.c:		struct special_entry *field = (struct special_entry *)entry;
trace.c:	struct seq_file *m = (struct seq_file *)file->private_data;
trace.c:	       offsetof(struct trace_iterator, seq));
trace.c:		       offsetof(struct trace_iterator, seq));
trace_mmiotrace.c:		(struct trace_mmiotrace_rw *)entry;
trace_mmiotrace.c:	struct mmiotrace_map *m	= (struct mmiotrace_map *)entry;
trace_mmiotrace.c:	struct print_entry *print = (struct print_entry *)entry;
trace_sched_wakeup.c:static void __wakeup_reset(struct trace_array *tr);
trace_sysprof.c:static DEFINE_PER_CPU(struct hrtimer, stack_trace_hrtimer);
trace_sysprof.c:	stack = ((char *)regs + sizeof(struct pt_regs));
trace_sysprof.c:		regs = (struct pt_regs *)current->thread.sp0 - 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