lkml.org 
[lkml]   [2017]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/6] perf: implement kprobe support to PERF_TYPE_PROBE
On Wed, Nov 15, 2017 at 09:23:36AM -0800, Song Liu wrote:
> +int perf_probe_init(struct perf_event *p_event)
> +{

> + __aligned_u64 aligned_probe_desc;
> +
> + /*
> + * attr.probe_desc may not be 64-bit aligned on 32-bit systems.
> + * Make an aligned copy of it to before u64_to_user_ptr().
> + */
> + memcpy(&aligned_probe_desc, &p_event->attr.probe_desc,
> + sizeof(__aligned_u64));
> +
> + if (copy_from_user(&pd, u64_to_user_ptr(aligned_probe_desc),
> + sizeof(struct probe_desc)))
> + return -EFAULT;

That doesn't seem to make any sense what so ever.. the alignment has no
effect on this usecase. Not to mention that the kernel variable should
very much already be aligned.

\
 
 \ /
  Last update: 2017-11-23 11:06    [W:0.208 / U:29.936 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site