[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100823162105.GA19164@infradead.org>
Date: Mon, 23 Aug 2010 12:21:05 -0400
From: Christoph Hellwig <hch@...radead.org>
To: Namhyung Kim <namhyung@...il.com>
Cc: Arnd Bergmann <arnd@...db.de>, Roland McGrath <roland@...hat.com>,
Oleg Nesterov <oleg@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3 RESEND] ptrace: cleanup address space conversion on
ptrace_request()
On Tue, Aug 24, 2010 at 01:06:15AM +0900, Namhyung Kim wrote:
> In some cases 'data' should be considered as a user pointer but it requires
> cast with additional __force markup which was missing. Rather than add the
> markups wherever needed, make use of a temporary variable of user pointer.
> This patch is based on compat_ptrace_request() implementation.
>
> Suggested-by: Arnd Bergmann <arnd@...db.de>
> Signed-off-by: Namhyung Kim <namhyung@...il.com>
> ---
> kernel/ptrace.c | 13 +++++++------
> 1 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/kernel/ptrace.c b/kernel/ptrace.c
> index 4afd9b8..7547b1c 100644
> --- a/kernel/ptrace.c
> +++ b/kernel/ptrace.c
> @@ -564,6 +564,7 @@ int ptrace_request(struct task_struct *child, long request,
> {
> int ret = -EIO;
> siginfo_t siginfo;
> + unsigned long __user *datap = (unsigned long __user __force *) data;
Just make this a
void __user *datap = (void __user *)data;
and you can pass it around withjout additional casts. Also no need
for the force here I think.
You'll still need a cast for the put_user calls, or you could just
convert them to copy_to_user which is fine with a void pointer.
--
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