From: Cyrill Gorcunov
> Sent: 03 May 2019 09:32
> On Thu, May 02, 2019 at 05:46:08PM -0400, Joel Savitz wrote:
> > > Won't be possible to use put_user here? Something like
> > >
> > > static int prctl_get_tasksize(unsigned long __user *uaddr)
> > > {
> > > return put_user(TASK_SIZE, uaddr)
On Thu, May 02, 2019 at 05:46:08PM -0400, Joel Savitz wrote:
> > Won't be possible to use put_user here? Something like
> >
> > static int prctl_get_tasksize(unsigned long __user *uaddr)
> > {
> > return put_user(TASK_SIZE, uaddr) ? -EFAULT : 0;
> > }
>
> What would be the benefit of using
чт, 2 мая 2019 г. в 13:52, Joel Savitz :
>
> When PR_GET_TASK_SIZE is passed to prctl, the kernel will attempt to
> copy the value of TASK_SIZE to the userspace address in arg2.
>
> Suggested-by: Alexey Dobriyan
> Signed-off-by: Joel Savitz
> ---
> include/uapi/linux/prctl.h | 3 +++
> kernel/s
> Won't be possible to use put_user here? Something like
>
> static int prctl_get_tasksize(unsigned long __user *uaddr)
> {
> return put_user(TASK_SIZE, uaddr) ? -EFAULT : 0;
> }
What would be the benefit of using put_user() over copy_to_user() in
this context?
On Thu, May 02, 2019 at 04:52:21PM -0400, Joel Savitz wrote:
> When PR_GET_TASK_SIZE is passed to prctl, the kernel will attempt to
> copy the value of TASK_SIZE to the userspace address in arg2.
>
> Suggested-by: Alexey Dobriyan
> Signed-off-by: Joel Savitz
> ---
> include/uapi/linux/prctl.h |
On Thu, May 02, 2019 at 04:52:21PM -0400, Joel Savitz wrote:
>
> +static int prctl_get_tasksize(void __user * uaddr)
> +{
> + unsigned long task_size = TASK_SIZE;
> + return copy_to_user(uaddr, &task_size, sizeof(unsigned long))
> + ? -EFAULT : 0;
> +}
Won't be possib
When PR_GET_TASK_SIZE is passed to prctl, the kernel will attempt to
copy the value of TASK_SIZE to the userspace address in arg2.
Suggested-by: Alexey Dobriyan
Signed-off-by: Joel Savitz
---
include/uapi/linux/prctl.h | 3 +++
kernel/sys.c | 10 ++
2 files changed, 13 in
7 matches
Mail list logo