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:	Mon, 3 Mar 2014 11:57:55 -0800
From:	Filipe Brandenburger <filbranden@...gle.com>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	Li Zefan <lizefan@...wei.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] tracing: correctly expand len expressions from
 __dynamic_array macro

Hi Steve,

I don't think this needs to be backported to stable, since the only
place that uses the high 16 bits of the offset field as the length is
filter_pred_strloc which only works for strings and sizeof(char) == 1
so that essentially whenever the bug is triggered, the actual stored
value is not used.

I have a follow up patch to expose that field to TP_fast_assign (as
something like __get_dynamic_array_length) in which case it's
important that this is fixed, otherwise for __dynamic_array of
something other than char we'll have a bug.

Thanks,
Filipe


On Mon, Mar 3, 2014 at 11:51 AM, Steven Rostedt <rostedt@...dmis.org> wrote:
> On Fri, 28 Feb 2014 21:32:16 -0800
> Filipe Brandenburger <filbranden@...gle.com> wrote:
>
>> This fixes expansion of the len argument in __dynamic_array macros.
>> The previous code from commit 7d536cb3f would not fully evaluate the
>> expression before multiplying its result by the size of the type.
>>
>> This went unnoticed because the length stored in the high 16 bits of the
>> offset (which is the one that was broken here) is only used by
>> filter_pred_strloc which only acts on strings for which the size of the
>> type is 1.
>>
>
> Was this visible in any of the tracepoints? Should this be marked for
> stable? It's been in the kernel for a long time (2009). Or is a new
> tracepoint showing a problem?
>
> -- Steve
>
>> Signed-off-by: Filipe Brandenburger <filbranden@...gle.com>
>> ---
>>  include/trace/ftrace.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
>> index 1a8b28d..82e8d89 100644
>> --- a/include/trace/ftrace.h
>> +++ b/include/trace/ftrace.h
>> @@ -375,7 +375,7 @@ ftrace_define_fields_##call(struct ftrace_event_call *event_call) \
>>  #define __dynamic_array(type, item, len)                             \
>>       __data_offsets->item = __data_size +                            \
>>                              offsetof(typeof(*entry), __data);        \
>> -     __data_offsets->item |= (len * sizeof(type)) << 16;             \
>> +     __data_offsets->item |= ((len) * sizeof(type)) << 16;           \
>>       __data_size += (len) * sizeof(type);
>>
>>  #undef __string
>
--
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