[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87tvl9nas6.fsf@xmission.com>
Date: Thu, 25 Oct 2018 13:25:45 -0500
From: ebiederm@...ssion.com (Eric W. Biederman)
To: Florian Fainelli <f.fainelli@...il.com>
Cc: linux-arm-kernel@...ts.infradead.org, andrew@...n.ch,
Russell King <linux@...linux.org.uk>,
Tony Lindgren <tony@...mide.com>,
Souptick Joarder <jrdr.linux@...il.com>,
linux-kernel@...r.kernel.org (open list)
Subject: Re: [PATCH] ARM: mm: Facilitate debugging CONFIG_KUSER_HELPERS disabled
Florian Fainelli <f.fainelli@...il.com> writes:
> Some software such as perf makes unconditional use of the special
> [vectors] page which is only provided when CONFIG_KUSER_HELPERS is
> enabled in the kernel.
>
> Facilitate the debugging of such situations by printing a debug message
> to the kernel log showing the task name and the faulting address.
Can't someone trigger this segv deliberately and spam the kerne log?
Doesn't this need something like printk_ratelimit or something to ensure
this message only gets printed once?
Eric
> Suggested-by: Russell King <rmk+kernel@...linux.org.uk>
> Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
> ---
> arch/arm/mm/fault.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
> index f4ea4c62c613..f17471fbc1c4 100644
> --- a/arch/arm/mm/fault.c
> +++ b/arch/arm/mm/fault.c
> @@ -173,6 +173,11 @@ __do_user_fault(struct task_struct *tsk, unsigned long addr,
> show_regs(regs);
> }
> #endif
> +#ifndef CONFIG_KUSER_HELPERS
> + if ((sig == SIGSEGV) && ((addr & PAGE_MASK) == 0xffff0000))
> + printk(KERN_DEBUG "%s: CONFIG_KUSER_HELPERS disabled at 0x%08lx\n",
> + tsk->comm, addr);
> +#endif
>
> tsk->thread.address = addr;
> tsk->thread.error_code = fsr;
Powered by blists - more mailing lists