[PATCH] ARM: mm: fix stack corruption when CONFIG_ARM_PV_FIXUP=y

Linus Walleij linus.walleij at linaro.org
Fri Sep 8 05:58:49 PDT 2023


Hi Zhizhou,

wow a great patch! I'm surprised no-one has been hit by this before.
I guess we were lucky.

On Thu, Sep 7, 2023 at 4:33 PM Zhizhou Zhang <zhizhou.zh at gmail.com> wrote:

> From: Zhizhou Zhang <zhizhouzhang at asrmicro.com>
>
> flush_cache_all() save registers to stack at function entry.
> If it's called after cache disabled, the data is written to
> memory directly. So the following clean cache operation corrupted
> registers saved by flush_cache_all(), including lr register.
> calling flush_cache_all() before turn off cache fixed the problem.
>
> Signed-off-by: Zhizhou Zhang <zhizhouzhang at asrmicro.com>

Reviewed-by: Linus Walleij <linus.walleij at linaro.org>

I would also add
Cc: stable at vger.kernel.org

Then please put this into Russell's patch tracker once review
is complete.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list