Re: [PATCH 1/4] Add support for userspace stacktraces in tracing/iter_ctrl

Frédéric Weisbecker
2008-10-12T13:32:19Z

2008/10/12 Török Edwin <edwintorok@gmail.com>:
> +static int copy_stack_frame(const void __user *fp, struct stack_frame *frame)
> +{
> + int ret;
> +
> + if (!access_ok(VERIFY_READ, fp, sizeof(*frame)))
> + return 0;
> +
> + ret = 1;
> + pagefault_disable();
> + if (__copy_from_user_inatomic(frame, fp, sizeof(*frame)))
> + ret = 0;
> + pagefault_enable();
> +
> + return ret;
> +}
> +

Hello Török,

I don't understand why you are using this pagefault disabling and
atomic copy here.
Wouldn't a simple copy_from_user actually take of this? You don't seem
to be in atomic
context.