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=-5.2 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 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 F08D8C433EF for ; Mon, 20 Sep 2021 21:15:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 9147961184 for ; Mon, 20 Sep 2021 21:15:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9147961184 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=HmdZrqabOZq687Ku8kOgHLfYQBnjqOErCjSTQokZCYY=; b=amQPKG8IR+M66I g7EojxpxDgqUyJQk7+AT57d2B1Md+6JT6ifjVZjdXYqMmQfr2NGyHNCCOGLddpb58JScoJkROtLtb lGo8fFixPkBxD7avSOvqFUalzRpo7FdGVTnNgx50YkGjCyt+MBNKGoWv2MTbDvjUOtX2cf+gxg+tf GIAb+LNJ1TslrfLCOsOXbHvcWAITidwbfgQIj03YHTCPsLo3PlYZF0IDlgsJbLCtLJZql5WH3EQJB eXEc5Xb1Q5hzHTcpHN3dBJev7fj3+genPFl7eQEHUkkoaJcd/SAeepsy3IhlftgCOqZEa2HUJBHNO K3Dq2iX1AR1Wcm6Ln+Dg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSQbI-0038mc-Po; Mon, 20 Sep 2021 21:13:20 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mSQbF-0038lt-CX for linux-arm-kernel@lists.infradead.org; Mon, 20 Sep 2021 21:13:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=JqKfZcPM6BusUUbROgVjbvOfDNskOXhKhFUiywhzdWk=; b=O+tsStd2TlnmfV/a/6iQ65Q9fe p26f3uEqNXt2yxpGr1CHFLZIWA8hAlMFNyeZLOGBBzt/6ROEjd4OHwZqqTLYagB6FSeTfPzPTqT2R 5oCd8Kv2IxKm/wi9mKIOwSPXx1KX6wPhXrqNCHoiLcNN8YP8d70JTktVyImISuSzxwcO3dL0XApRd qvTXKgwBsrxMkKluxelLDnOe7xKG7m3WHcI19Epeo1IV4ypEA4zilN1CKQoXWovp91FaEzXJ+abqi zL0Pr4OLZznWBUla0AgPGDcCyxxoQ+HiK7BS8zT6+UyJp+VaeVPaT8d0xcY7S64pdb613eBMAtJKl HNQka2gA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:54686) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mSQb9-00022v-U8; Mon, 20 Sep 2021 22:13:11 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1mSQb6-0002bq-P8; Mon, 20 Sep 2021 22:13:08 +0100 Date: Mon, 20 Sep 2021 22:13:08 +0100 From: "Russell King (Oracle)" To: Tim Harvey Cc: Fabio Estevam , Shawn Guo , Pengutronix Kernel Team , Linux ARM Mailing List , Lee Jones , Robin Murphy , NXP Linux Team Subject: Re: arm32 insecure W+X mapping Message-ID: References: <20210819212819.GM22278@shell.armlinux.org.uk> <20210820001646.GN22278@shell.armlinux.org.uk> <381afc78-5a7f-8286-76ea-2e6c7867972d@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210920_141317_479272_F132249E X-CRM114-Status: GOOD ( 26.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Sep 20, 2021 at 01:56:51PM -0700, Tim Harvey wrote: > On Mon, Sep 20, 2021 at 9:22 AM Russell King (Oracle) > wrote: > > > > On Wed, Sep 15, 2021 at 06:44:56AM -0300, Fabio Estevam wrote: > > > Not sure if this is related or not to the following behavior that I am seeing. > > > > > > On 5.15-rc1 I see the following on an imx6dl based board: > > > > > > [ 0.123336] imx6q_suspend_init: failed to find ocram device! > > > > Looking at the platforms I currently have, two imx6q which booted 5.13 > > do not have this problem, but one imx6dl that booted 5.14 does seem to > > spit out this message. > > > > What I do notice is that in the 5.14 case, /proc/iomem reports that the > > ocram device does exist: > > > > 00900000-0091ffff : 900000.sram sram@900000 > > > > so I'm suspecting an init ordering issue. > > > > It looks on the face of it to be a regression between 5.13 and 5.14. > > I'm guessing that the sram device isn't being probed early enough. > > Maybe some of the initialisation/device model debug options can > > identify what changed? > > > > Here's what I see on both imx6dl and imx6q with both CONFIG_DEBUG_WX > and CONFIG_SUSPEND enabled: > 5.13: 'Checked W+X mappings: FAILED, 1 W+X pages found' on both imx6q and imx6dl > 5.14: No W+X failure on either board.... so something different for sure > 5.15-rc2: same as 5.14 > > So my results differ from yours but showed that something has been > fixed vs regressed. I'll bisect and see if I can figure out when my > original issue I reported here went away. I'm not sure we are disagreeing. I don't have CONFIG_DEBUG_WX enabled, but in 5.13, I see in /sys/kernel/debug/kernel_page_tables: 0xf087d000-0xf087e000 4K KERNEL RW x SHD MEM/BUFFERABLE/WC and /proc/vmallocinfo has: 0xf087d000-0xf087f000 8192 imx6_pm_common_init+0x13c/0x390 phys=0x00900000 ioremap So this will give a W+X failure. Under 5.14, there is no mapping for this RAM in kernel_page_tables nor vmallocinfo - which is not surprising because imx6_pm_common_init() said it failed to find the ocram, and it only gets one shot at it. So there won't be a W+X failure. In other words, we are in complete agreement. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel