[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20090312031449.83F34FC3B6@magilla.sf.frob.com>
Date: Wed, 11 Mar 2009 20:14:49 -0700 (PDT)
From: Roland McGrath <roland@...hat.com>
To: Ingo Molnar <mingo@...e.hu>
Cc: prasad@...ux.vnet.ibm.com,
Andrew Morton <akpm@...ux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Alan Stern <stern@...land.harvard.edu>
Subject: Re: [patch 08/11] Modify Ptrace routines to access breakpoint
registers
> I dont see where this security check has been carried over into
> the generic code. The new code has:
>
> +int arch_check_va_in_userspace(unsigned long va, struct task_struct *tsk)
> +{
> + return (va < TASK_SIZE);
> +}
>
> but i think that misses the detail that it's not just the start
> address of an x86 breakpoint that has to be considered, but also
> the end addess of it.
It also needs to be TASK_SIZE_OF(tsk), which is shorthand for the same
logic already in the 64-bit debugreg_addr_limit().
For the end-of-range issue, it perhaps ought to check size-1 instead of
wordsize-1, i.e. through the end of the actual breakpoint range, not of the
word containing it. What debugreg_addr_limit() does is the historical
ptrace check on x86, but I don't see a reason to disallow a 1-byte
watchpoint on the last addressable user-space byte if the hardware will
support it.
So either the arch check should take a size parameter, or the
arch-independent code can just call it with address+size-1.
Thanks,
Roland
--
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