Re: CVE-2023-52451: powerpc/pseries/memhp: Fix access beyond end of drmem array

Greg Kroah-Hartman
2024-02-26T15:06:58Z

On Mon, Feb 26, 2024 at 03:52:11PM +0100, Michal Hocko wrote:
> On Thu 22-02-24 17:21:58, Greg KH wrote:
> > Description
> > ===========
> >
> > In the Linux kernel, the following vulnerability has been resolved:
> >
> > powerpc/pseries/memhp: Fix access beyond end of drmem array
> >
> > dlpar_memory_remove_by_index() may access beyond the bounds of the
> > drmem lmb array when the LMB lookup fails to match an entry with the
> > given DRC index. When the search fails, the cursor is left pointing to
> > &drmem_info->lmbs[drmem_info->n_lmbs], which is one element past the
> > last valid entry in the array. The debug message at the end of the
> > function then dereferences this pointer:
> >
> > pr_debug("Failed to hot-remove memory at %llx\n",
> > lmb->base_addr);
>
> While this is a reasonable fix and the stable material it is really
> unclear to me why it has gained a CVE. Memory hotplug is a privileged
> operation. Could you clarify please?

As you know, history has shown us that accessing out of your allocated
memory can cause problems, and we can not assume use-cases, as we don't
know how everyone uses our codebase, so marking places where we fix
out-of-bound memory accesses is resolving a weakness in the codebase,
hence a CVE assignment.

If your systems are not vulnerable to this specific issue, wonderful, no
need to take it, but why wouldn't you want to take a fix that resolves a
known weakness?

thanks,

greg k-h