From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD91AC43461 for ; Mon, 14 Sep 2020 10:39:21 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D88FA207BB for ; Mon, 14 Sep 2020 10:39:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hj8qcugT"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=aurel32.net header.i=@aurel32.net header.b="cIcaToVt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D88FA207BB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=aurel32.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=szo714OoretTwNrkasBHzue8WWkrJEDuG2ZsXzi6e1E=; b=hj8qcugTEbssQhaNZpSs16AWG gjoHqpbRBIe8TEDVR8WUgUeTWRt441eKtU1QxM6HlsSUD3ACcxrcgoxGxoYS4vIQu/GrI+XlfNVld 0miE4aYbz86BUY1/PWvNnCjpOGP2vlxx04gwD1RICHqatgsW0jnPtFVVMzBg/Vw+JDxPfQUmGkd8u fZNQh9qalw1JSpyFdO2HuKWa56XeWA1GtByn2s5xYfJZ9IB35nNIo4Rij+JRU1cPK/onJ46KfvTLK aFK0QE7piEYGxlrR2hUU8moxH2QeuGCeJlC1crgIldDVfJVwMx7UBpWuIefD+0QInFF1q5kIkeDFj jcuGvguQA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHlt4-00089W-7M; Mon, 14 Sep 2020 10:39:06 +0000 Received: from hall.aurel32.net ([2001:bc8:30d7:100::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHlt1-00087Q-Cd for linux-riscv@lists.infradead.org; Mon, 14 Sep 2020 10:39:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=aurel32.net ; s=202004.hall; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Content-Transfer-Encoding:From:Reply-To: Subject:Content-ID:Content-Description:X-Debbugs-Cc; bh=wlDIRDEfQWNob552Fwn5LzRLZbzE03QEuC1qTEAINRc=; b=cIcaToVtgQV2EaIpn+9phQNfAf Xs+f1cwrLc7phMf80weTR9ISZSPzE0C4tpCZGbLV9An2Wpy9k9xjPSTziIN0UUSUxmthKj+TEGh4p JbrqNbMH5QnBvF8CCeIrt60XCHtye5EmobBMb3Fa1C64YZmeqCiisQHwknK9JDku02Hgu9b4R+SFt gbez+4TVMC+cQ9azI90zA50Vx4zry07F8glQ9yhqeF99KoxAi6N8Kyb7iCxi91my2VTfFzLOgwqiN SRKyU8CB5XZQ+MLWdfiJN3XRDUaXASQYhMY4wEHq1lufzoESIDrombnpb7FKjZ21PrndsJ/3Csbga hkmubpXA==; Received: from [2a01:e35:2fdd:a4e1:fe91:fc89:bc43:b814] (helo=ohm.rr44.fr) by hall.aurel32.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kHlsb-0001fB-Oz; Mon, 14 Sep 2020 12:38:37 +0200 Received: from aurel32 by ohm.rr44.fr with local (Exim 4.94) (envelope-from ) id 1kHlsa-00Cx5R-Sz; Mon, 14 Sep 2020 12:38:36 +0200 Date: Mon, 14 Sep 2020 12:38:36 +0200 From: Aurelien Jarno To: Guo Ren Subject: Re: [PATCH V2 1/3] riscv: Fixup static_obj() fail Message-ID: <20200914103836.GB2705@aurel32.net> Mail-Followup-To: Guo Ren , Palmer Dabbelt , Paul Walmsley , Anup Patel , Greentime Hu , Zong Li , Albert Ou , Thomas Gleixner , Tycho Andersen , Nick Hu , linux-riscv , Guo Ren , Linux Kernel Mailing List , linux-csky@vger.kernel.org References: <1593266228-61125-1-git-send-email-guoren@kernel.org> <1593266228-61125-2-git-send-email-guoren@kernel.org> <20200911204512.GA2705@aurel32.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.14.6 (2020-07-11) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200914_063903_745710_BEEC9400 X-CRM114-Status: GOOD ( 14.92 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tycho Andersen , Albert Ou , Nick Hu , Anup Patel , Palmer Dabbelt , Linux Kernel Mailing List , linux-csky@vger.kernel.org, Guo Ren , Zong Li , Paul Walmsley , Greentime Hu , Thomas Gleixner , linux-riscv Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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@aurel32.net http://www.aurel32.net _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv