Re: [PATCH 29/47] Update CRISv32 traps.c

Andrew Morton
2007-12-12T11:21:35Z

On Fri, 30 Nov 2007 16:22:50 +0100 Jesper Nilsson <jesper.nilsson@axis.com> wrote:

> +#ifdef CONFIG_DEBUG_BUGVERBOSE
> +void
> +handle_BUG(struct pt_regs *regs)
> {
> - asm volatile("setf m");
> + struct bug_frame f;
> + unsigned char c;
> + unsigned long irp = regs->irp;
> +
> + if (__copy_from_user(&f, (const void __user *)(irp - 8), sizeof f))
> + return;
> + if (f.prefix != BUG_PREFIX || f.magic != BUG_MAGIC)
> + return;
> + if (__get_user(c, f.filename))
> + f.filename = "<bad filename>";
> +
> + printk("kernel BUG at %s:%d!\n", f.filename, f.line);
> }
> +#endif

Why is it accessing user memory in the BUG handler?