Re: [PATCH next] ACPI: APEI: EINJ: prevent memory corruption in error_type_set()
From: Rafael J. Wysocki
Date: Thu Jun 26 2025 - 14:47:57 EST
On Wed, Jun 25, 2025 at 11:19 PM Ira Weiny <ira.weiny@xxxxxxxxx> wrote:
>
> Dan Carpenter wrote:
> > The "einj_buf" buffer is 32 chars. If "count" is larger than that it
> > results in memory corruption. Cap it at 31 so that we leave the last
> > character as a NUL terminator. By the way, the highest reasonable value
> > for "count" is 24.
> >
> > Fixes: 0c6176e1e186 ("ACPI: APEI: EINJ: Enable the discovery of EINJv2 capabilities")
> > Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
>
> Reviewed-by: Ira Weiny <ira.weiny@xxxxxxxxx>
Applied, thanks!