linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Tim Harvey <tharvey@gateworks.com>
Cc: Fabio Estevam <festevam@gmail.com>,
	Shawn Guo <shawnguo@kernel.org>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Linux ARM Mailing List <linux-arm-kernel@lists.infradead.org>,
	Lee Jones <lee.jones@linaro.org>,
	Robin Murphy <robin.murphy@arm.com>,
	NXP Linux Team <linux-imx@nxp.com>
Subject: Re: arm32 insecure W+X mapping
Date: Mon, 20 Sep 2021 22:13:08 +0100	[thread overview]
Message-ID: <YUj5ZFTsRNxWdyOY@shell.armlinux.org.uk> (raw)
In-Reply-To: <CAJ+vNU0NTUnuu0DHJDDyTR81ThHKdVL9xVweCwg7RVtNDfyVjQ@mail.gmail.com>

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)
> <linux@armlinux.org.uk> 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

  reply	other threads:[~2021-09-20 21:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19 17:19 arm32 insecure W+X mapping Tim Harvey
2021-08-19 21:28 ` Russell King (Oracle)
2021-08-19 23:59   ` Tim Harvey
2021-08-20  0:16     ` Russell King (Oracle)
2021-08-20 16:06       ` Tim Harvey
2021-08-20 17:48         ` Robin Murphy
2021-08-20 18:41           ` Tim Harvey
2021-09-07 17:48             ` Tim Harvey
2021-09-07 19:22               ` Russell King (Oracle)
2021-09-15  9:44               ` Fabio Estevam
2021-09-15 15:07                 ` Tim Harvey
2021-09-20 16:22                 ` Russell King (Oracle)
2021-09-20 20:56                   ` Tim Harvey
2021-09-20 21:13                     ` Russell King (Oracle) [this message]
2021-09-20 22:53                       ` Tim Harvey
2021-09-20 23:12                         ` Fabio Estevam
2021-09-20 23:19                         ` Russell King (Oracle)
2021-09-21  0:21                           ` Fabio Estevam
2021-09-21 15:13                             ` Russell King (Oracle)
2021-09-22  3:37                           ` Shawn Guo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YUj5ZFTsRNxWdyOY@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=robin.murphy@arm.com \
    --cc=shawnguo@kernel.org \
    --cc=tharvey@gateworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).