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: <1374851376.6580.34.camel@gandalf.local.home>
Date:	Fri, 26 Jul 2013 11:09:36 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Li Zefan <lizefan@...wei.com>
Cc:	Frederic Weisbecker <fweisbec@...il.com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2][RESEND] tracing: Shrink the size of struct
 ftrace_event_field

On Thu, 2013-07-25 at 10:28 +0800, Li Zefan wrote:
>  
>  struct event_filter {
> diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
> index 53582e9..67aee85 100644
> --- a/kernel/trace/trace_events.c
> +++ b/kernel/trace/trace_events.c
> @@ -111,6 +111,11 @@ static int __trace_define_field(struct list_head *head, const char *type,
>  	field->size = size;
>  	field->is_signed = is_signed;

I think we should just change is_signed to bool. At least the parameter.
Or we can make the assignment: field->is_signed = !!is_signed; and nuke
the check below.

>  
> +	WARN_ON(offset >= (1 << 12));
> +	WARN_ON(size >= (1 << 12));
> +	WARN_ON(is_signed >= (1 << 1));
> +	WARN_ON(field->filter_type >= (1 << 4));

Note, the test for field->filter_type is wrong.

We should make a helper macro:

#define VERIFY_SIZE(type) WARN_ON(type > field->type)

and then have:

	VERIFY_SIZE(offset);
	VERIFY_SIZE(size);
	VERIFY_SIZE(filter_type);

-- Steve

> +
>  	list_add(&field->link, head);
>  
>  	return 0;
> -- 1.8.0.2


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