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, 07 Dec 2009 15:35:59 +0900
From:	OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
To:	Xiao Guangrong <xiaoguangrong@...fujitsu.com>
Cc:	Ingo Molnar <mingo@...e.hu>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Paul Mackerras <paulus@...ba.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Li Zefan <lizf@...fujitsu.com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] perf_event: fix for processing raw event - fix

OGAWA Hirofumi <hirofumi@...l.parknet.co.jp> writes:

> Xiao Guangrong <xiaoguangrong@...fujitsu.com> writes:
>
>> raw->size is not used, this patch just cleanup it
>
> Oops, I didn't notice those. Thanks.
>
>> Signed-off-by: Xiao Guangrong <xiaoguangrong@...fujitsu.com>
>> ---
>>  tools/perf/builtin-kmem.c  |   38 +++++++-----------
>>  tools/perf/builtin-sched.c |   94 +++++++++++++++++++------------------------
>>  2 files changed, 56 insertions(+), 76 deletions(-)
>>
>> diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c
>> index f84d7a3..7551a5f 100644
>> --- a/tools/perf/builtin-kmem.c
>> +++ b/tools/perf/builtin-kmem.c
>> @@ -57,11 +57,6 @@ static struct rb_root root_caller_sorted;
>>  static unsigned long total_requested, total_allocated;
>>  static unsigned long nr_allocs, nr_cross_allocs;
>>  
>> -struct raw_event_sample {
>> -	u32 size;
>> -	char data[0];
>> -};
>> -
>>  #define PATH_SYS_NODE	"/sys/devices/system/node"
>>  
>>  static void init_cpunode_map(void)
>> @@ -201,7 +196,7 @@ static void insert_caller_stat(unsigned long call_site,
>>  	}
>>  }
>>  
>> -static void process_alloc_event(struct raw_event_sample *raw,
>> +static void process_alloc_event(void *data,
>>  				struct event *event,
>>  				int cpu,
>>  				u64 timestamp __used,
>
> How about the following patch instead of playing with unsafe "void *"?
> With this, I guess it does type check, and filed handling functions can

s/filed handling/field handling of sample raw data/

> check "size" by passing "struct sample_raw_data" instead of "void *" in
> future.
-- 
OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
--
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