[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1652523982-1310150159-cardhu_decombobulator_blackberry.rim.net-183695056-@b1.c19.bise6.blackberry>
Date: Fri, 8 Jul 2011 18:35:56 +0000
From: "Dan Rosenberg" <drosenberg@...curity.com>
To: "Andrew Morton" <akpm@...ux-foundation.org>
Cc: chris@...kel.net, security@...nel.org,
linux-kernel@...r.kernel.org, "Oleg Nesterov" <oleg@...hat.com>
Subject: Re: [Security] [PATCH] xtensa: prevent arbitrary read in ptrace
Sorry for the top post and any email mangling (mobile).
I only used EIO to mirror the existing behavior in ptrace_getxregs(). EFAULT seems better.
-Dan
------Original Message------
From: Andrew Morton
To: Dan Rosenberg
Cc: chris@...kel.net
Cc: security@...nel.org
Cc: linux-kernel@...r.kernel.org
Cc: Oleg Nesterov
Subject: Re: [Security] [PATCH] xtensa: prevent arbitrary read in ptrace
Sent: Jul 8, 2011 2:27 PM
On Thu, 07 Jul 2011 20:03:54 -0400
Dan Rosenberg <drosenberg@...curity.com> wrote:
> Prevent an arbitrary kernel read. Check the user pointer with
> access_ok() before copying data in.
>
> Signed-off-by: Dan Rosenberg <drosenberg@...curity.com>
> Cc: stable@...nel.org
> ---
> arch/xtensa/kernel/ptrace.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/arch/xtensa/kernel/ptrace.c b/arch/xtensa/kernel/ptrace.c
> index c72c947..ddce75e 100644
> --- a/arch/xtensa/kernel/ptrace.c
> +++ b/arch/xtensa/kernel/ptrace.c
> @@ -147,6 +147,9 @@ int ptrace_setxregs(struct task_struct *child, void __user *uregs)
> elf_xtregs_t *xtregs = uregs;
> int ret = 0;
>
> + if (!access_ok(VERIFY_READ, uregs, sizeof(elf_xtregs_t)))
> + return -EIO;
This should be -EFAULT, methinks?
> +
> #if XTENSA_HAVE_COPROCESSORS
> /* Flush all coprocessors before we overwrite them. */
> coprocessor_flush_all(ti);
Powered by blists - more mailing lists