[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200914103836.GB2705@aurel32.net>
Date: Mon, 14 Sep 2020 12:38:36 +0200
From: Aurelien Jarno <aurelien@...el32.net>
To: Guo Ren <guoren@...nel.org>
Cc: Palmer Dabbelt <palmerdabbelt@...gle.com>,
Paul Walmsley <paul.walmsley@...ive.com>,
Anup Patel <anup@...infault.org>,
Greentime Hu <greentime.hu@...ive.com>,
Zong Li <zong.li@...ive.com>,
Albert Ou <aou@...s.berkeley.edu>,
Thomas Gleixner <tglx@...utronix.de>,
Tycho Andersen <tycho@...ho.ws>,
Nick Hu <nickhu@...estech.com>,
linux-riscv <linux-riscv@...ts.infradead.org>,
Guo Ren <guoren@...ux.alibaba.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-csky@...r.kernel.org
Subject: Re: [PATCH V2 1/3] riscv: Fixup static_obj() fail
On 2020-09-12 10:39, Guo Ren wrote:
> It's come from mm/usercopy.c
> /* Is this address range in the kernel text area? */
> static inline void check_kernel_text_object(const unsigned long ptr,
> unsigned long n, bool to_user)
> {
> unsigned long textlow = (unsigned long)_stext;
> unsigned long texthigh = (unsigned long)_etext;
> unsigned long textlow_linear, texthigh_linear;
>
> if (overlaps(ptr, n, textlow, texthigh))
> usercopy_abort("kernel text", NULL, to_user, ptr - textlow, n);
>
> The __init_text/data areas will be freed after bootup, so I think it should be:
> - unsigned long textlow = (unsigned long)_stext;
> + unsigned long textlow = (unsigned long)_text;
>
> That means _stext should include init_text/data and _text is only for freeable.
I have no idea if it is the right thing to do or not, but I can confirm
this fixes the issue.
How should we proceed to get that fixed in time for 5.9? For the older
branches where it has been backported (so far 5.7 and 5.8), should we
just get that commit reverted instead?
Thanks,
Aurelien
--
Aurelien Jarno GPG: 4096R/1DDD8C9B
aurelien@...el32.net http://www.aurel32.net
Powered by blists - more mailing lists