kernel virtual memory access (from app) does not generate segfault
anfei
anfei.zhou at gmail.com
Tue Jun 8 10:19:34 EDT 2010
On Tue, Jun 08, 2010 at 02:36:05PM +0100, Russell King - ARM Linux wrote:
> On Tue, Jun 08, 2010 at 09:29:40PM +0800, anfei wrote:
> > Hi Russell,
> >
> > On Wed, Apr 21, 2010 at 09:11:49PM +0800, anfei wrote:
> > > Patch updated, and with comment log.
> > >
> > > ===
> > > ARM: Proper prefetch abort handling on pre-ARMv6
> > >
> > > Instruction faults on pre-ARMv6 CPUs are interpreted as
> > > a 'translation fault', but do_translation_fault doesn't
> > > handle well if user mode trying to run instruction above
> > > TASK_SIZE, and result in the infinite retry of that
> > > instruction.
> > >
> > > Signed-off-by: Anfei Zhou <anfei.zhou at gmail.com>
> > > ---
> > > arch/arm/mm/fault.c | 3 +++
> > > 1 files changed, 3 insertions(+), 0 deletions(-)
> > >
> > > diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
> > > index 9d40c34..8ad75e9 100644
> > > --- a/arch/arm/mm/fault.c
> > > +++ b/arch/arm/mm/fault.c
> > > @@ -393,6 +393,9 @@ do_translation_fault(unsigned long addr, unsigned int fsr,
> > > if (addr < TASK_SIZE)
> > > return do_page_fault(addr, fsr, regs);
> > >
> > > + if (user_mode(regs))
> > > + goto bad_area;
> > > +
> > > index = pgd_index(addr);
> > >
> > > /*
> >
> > This patch is still not into the mainline, will you plan to apply it?
>
> I had, but as it isn't in the patch system, it got buried and forgotten.
> Could you submit it to the patch system please? Just emailing it in
> a similar manner to that above, but with a subject of
> "Proper prefetch abort handling on pre-ARMv6" and an additional
> "KernelVersion: 2.6.whatever" line to the patch system should suffice.
Done, thanks!
Anfei.
More information about the linux-arm-kernel
mailing list