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=-6.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 54363C4338F for ; Fri, 20 Aug 2021 00:18:58 +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 1BFE061053 for ; Fri, 20 Aug 2021 00:18:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1BFE061053 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=mXil8X0dR3//ztZOFhQdgMv6Hx4VEa+QbE0HYIgq7SU=; b=JlvptUaMySVgl0 RHNEycapf1y4lBm2bdSbBfqIS9yGYmUYabtfEv/f32ULaNQsrxrKR/BVh8eaoYZUWRi0yS1crKv1y 8PddFVM8jrZ70H4yvbhwZsNdbwgmcz71vD8oym7cLBx970f+uE2q3ZWg/bXEFAy6a6lubH1QWN8uC y7ni/nGkX4d7mYHocJ15jtkoLCMLgiVtsVy+f1KT9KfigtRvKwl+Y74yhvM1iacDiK4tBnDAD2tVK aMRbQ5z3MMLYrZ7J2bWZpX5gq08ka4+3XrjCSuSEb5J6ZkHKj4fb/rnWphnHR8ghlDn7oF3pXJnKW 3qRln1MmkKFaHZmPyCVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mGsDO-009nnI-1F; Fri, 20 Aug 2021 00:16:54 +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 1mGsDI-009nmx-Fl for linux-arm-kernel@lists.infradead.org; Fri, 20 Aug 2021 00:16:52 +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=zURuW9TQ7P+epfUsADAq6btCAne+k11HLF3fwO1me/c=; b=AVyiFnUUKM2OulBsWNFMKp7ea pHC5v9h8cPXHPLQcMFmC6dwIOJJwR+tEWrIwmTrAE0fDGwDRyIUjy1aa325i7wJOCdHwWHjacO8+u sxAzRMigMKJu5Rf1Pc1Usnmv3yoek5RGRufhLSLOrcojkP/L6LSD0lJcrUHRGtRcFgUCGAOqzgzZe +uraI6SikckfZR7wEf9nQ2Z5tstvUdpx/b0X3SNQ4L4RbP4c4K9ahh9Jm8tixL6xZUVAxOXOItIkO bG13zWkFPr96PTkhslx4L78+U36Do8U1PHiLnmFLUTxaEw3K9Xxz6McqU44gCvkdWdnIlGol2tu7C svvHHLNGQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:47464) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mGsDG-0006aV-LT; Fri, 20 Aug 2021 01:16:46 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1mGsDG-0002pS-9f; Fri, 20 Aug 2021 01:16:46 +0100 Date: Fri, 20 Aug 2021 01:16:46 +0100 From: "Russell King (Oracle)" To: Tim Harvey Cc: Linux ARM Mailing List Subject: Re: arm32 insecure W+X mapping Message-ID: <20210820001646.GN22278@shell.armlinux.org.uk> References: <20210819212819.GM22278@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210819_171648_573961_6BC1C35C X-CRM114-Status: GOOD ( 18.93 ) 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 Thu, Aug 19, 2021 at 04:59:15PM -0700, Tim Harvey wrote: > On Thu, Aug 19, 2021 at 2:28 PM Russell King (Oracle) > wrote: > > > > On Thu, Aug 19, 2021 at 10:19:46AM -0700, Tim Harvey wrote: > > > Greetings, > > > > > > Since commit a8e53c151fe7 "(ARM: 8737/1: mm: dump: add checking for > > > writable and executable)" I've been seeing the following appear on my > > > arm32 kernel: > > > > > > arm/mm: Found insecure W+X mapping at address 0xf087d000 > > > ... > > > Checked W+X mappings: FAILED, 1 W+X pages found > > > > > > As I haven't seen others report this I assume it's something unique to > > > my kernel configuration. How do I debug what is causing the insecure > > > page? > > > > If you check /proc/vmallocinfo, it should tell you the physical > > address that was mapped there, and the function that created the > > mapping. That should give enough clues to track it down. > > > > Russell, > > Thanks for the tip! > > # dmesg | grep insecure > [ 13.219582] arm/mm: Found insecure W+X mapping at address 0xf087d000 > # cat /proc/vmallocinfo | grep 0xf0 > 0x5f3045dd-0xf0020e05 20480 imx6_pm_get_base+0x64/0x98 phys=0x020e0000 ioremap > 0xf0020e05-0x6e748217 8192 dma_common_contiguous_remap+0x88/0xa4 dma-coherent > 0x127639d7-0x334ee291 4096 iotable_init+0x0/0xf0 phys=0x00a00000 ioremap Oh... the kernel's %p pointer munging (for security reasons) is affecting your ability to debug your problem. Assuming this is a recent kernel, you can disable this by passing "no_hash_pointers" on the kernel command line. You should then see real addresses (and a big fat message at boot time about it. -- 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