arm32 insecure W+X mapping

Fabio Estevam festevam at gmail.com
Mon Sep 20 16:12:38 PDT 2021


Hi Tim,

On Mon, Sep 20, 2021 at 7:53 PM Tim Harvey <tharvey at gateworks.com> wrote:

> Ok - makes sense.
>
> I bisected this to cc8870bf4c3a ("ARM: imx6q: drop
> of_platform_default_populate() from init_machine").
>
> After that patch we get:
> [    0.133082] imx6q_suspend_init: failed to find ocram device!
>
> and no longer see the W+X failure.
>
> Fabio, I suspect this is the regression that you are hitting regarding
> suspend and that this needs to be reverted.

Thanks for bisecting it. Yes, after reverting such commit,
suspend/resume works again.

The first time it takes a long time to resume:

# echo enabled > /sys/class/tty/ttymxc0/power/wakeup
# echo mem >  /sys/power/state
[   15.599190] PM: suspend entry (deep)
[   15.640341] Filesystems sync: 0.036 seconds
[   64.492708] imx-sdma 20ec000.sdma: external firmware not found,
using ROM firmware

>From 15 to 69s it is just waiting to suspend.

[   69.611037] Freezing user space processes ...
[   69.614849] cfg80211: failed to load regulatory.db
[   69.625538] (elapsed 0.014 seconds) done.
[   69.630737] OOM killer disabled.
[   69.634227] Freezing remaining freezable tasks ... (elapsed 0.006
seconds) done.
[   69.648817] printk: Suspending console(s) (use no_console_suspend to debug)
[   70.269165] PM: suspend devices took 0.610 seconds
[   70.288058] Disabling non-boot CPUs ...
[   70.362203] mmc1: queuing unknown CIS tuple 0x01 [d9 01 ff] (3 bytes)
[   70.371768] mmc1: queuing unknown CIS tuple 0x1a [01 01 00 02 07] (5 bytes)
[   70.375904] mmc1: queuing unknown CIS tuple 0x1b [c1 41 30 30 ff ff
32 00] (8 bytes)
[   70.376832] mmc1: queuing unknown CIS tuple 0x14 [] (0 bytes)
[   70.400971] PM: resume devices took 0.100 seconds
[   70.445566] OOM killer enabled.
[   70.448883] Restarting tasks ... done.
[   70.461806] PM: suspend exit

Subsequent times, there is no such delay.

# echo mem >  /sys/power/state
[   87.687476] PM: suspend entry (deep)
[   87.755373] Filesystems sync: 0.064 seconds
[   87.764171] Freezing user space processes ... (elapsed 0.002 seconds) done.
[   87.773544] OOM killer disabled.
[   87.776968] Freezing remaining freezable tasks ... (elapsed 0.002
seconds) done.
[   87.786944] printk: Suspending console(s) (use no_console_suspend to debug)
[   88.405849] PM: suspend devices took 0.610 seconds
[   88.423879] Disabling non-boot CPUs ...
[   88.492122] mmc1: queuing unknown CIS tuple 0x01 [d9 01 ff] (3 bytes)
[   88.501684] mmc1: queuing unknown CIS tuple 0x1a [01 01 00 02 07] (5 bytes)
[   88.505837] mmc1: queuing unknown CIS tuple 0x1b [c1 41 30 30 ff ff
32 00] (8 bytes)
[   88.506782] mmc1: queuing unknown CIS tuple 0x14 [] (0 bytes)
[   88.529321] PM: resume devices took 0.090 seconds
[   88.573766] OOM killer enabled.
[   88.577090] Restarting tasks ... done.
[   88.587390] PM: suspend exit
#

That's an orthogonal issue though.

I will send the revert.

> That will still leave the W+X issue needing to be fixed at some point.

Yes, agreed.



More information about the linux-arm-kernel mailing list