[PATCH] powerpc/powernv: Validate memcons descriptor and output buffer

Michael Ellerman mpe at ellerman.id.au
Tue Jan 24 21:21:22 AEDT 2017


Gavin Shan <gwshan at linux.vnet.ibm.com> writes:

> Currently, it's assumed that memcons and its output buffer are included
> in the linear mapping. It's not true when "mem=384M" is included in
> bootargs. The system runs into kernel crash eventually.
>
>    # od -x /proc/device-tree/ibm,opal/ibm,opal-memcons
>    0000000 0000 0000 0b30 0010
>    0000010
>
> This validates memcons descriptor and its output buffer to ensure they
> are valid in linear mapping. Otherwise, the interface won't be populated
> to avoid kernel crash during system boot.
>
> Cc: stable at vger.kernel.org #3.15+
> Fixes: bfc36894a48 ("powerpc/powernv: Add OPAL message log interface")
> Signed-off-by: Gavin Shan <gwshan at linux.vnet.ibm.com>

Hmm.

Arguably the memcons shouldn't be in the linear map at all.

AFAICS the kernel only ever reads from it, so really it should be
explicitly mapped, and mapped read only.

That would also fix this problem :D

cheers


More information about the Linuxppc-dev mailing list