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  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:   Thu, 23 Nov 2017 11:06:16 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Song Liu <songliubraving@...com>
Cc:     rostedt@...dmis.org, mingo@...hat.com, davem@...emloft.net,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        daniel@...earbox.net, kernel-team@...com
Subject: Re: [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.

Powered by blists - more mailing lists