CVE-2023-54189: pstore/ram: Add check for kstrdup
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
pstore/ram: Add check for kstrdup
Add check for the return value of kstrdup() and return the error if it fails in order to avoid NULL pointer dereference.
The Linux kernel CVE team has assigned CVE-2023-54189 to this issue.
Affected and fixed versions
===========================
Issue introduced in 5.4.12 with commit c617a3b777b92a0e80ceff2dffaae9350d4c3850 and fixed in 5.4.251 with commit 8430a8e8e85420d4cb51dcb08b0278ab194ea82f Issue introduced in 5.5 with commit e163fdb3f7f8c62dccf194f3f37a7bcb3c333aa8 and fixed in 5.10.188 with commit a14cb307267ba7a1715403e071bdc4deda77eef5 Issue introduced in 5.5 with commit e163fdb3f7f8c62dccf194f3f37a7bcb3c333aa8 and fixed in 5.15.121 with commit 38a9d7dac3ad25323145b4aaea3b5f434f50011d Issue introduced in 5.5 with commit e163fdb3f7f8c62dccf194f3f37a7bcb3c333aa8 and fixed in 6.1.39 with commit f57ba91a46d3fc52bfdac9cca5cf5572ec7afd6d Issue introduced in 5.5 with commit e163fdb3f7f8c62dccf194f3f37a7bcb3c333aa8 and fixed in 6.3.13 with commit 2a764a2facd9dd88a69777200f65dfd0182765dc Issue introduced in 5.5 with commit e163fdb3f7f8c62dccf194f3f37a7bcb3c333aa8 and fixed in 6.4.4 with commit 065c81ae5817b245bb9feb6d54e027702740b49a Issue introduced in 5.5 with commit e163fdb3f7f8c62dccf194f3f37a7bcb3c333aa8 and fixed in 6.5 with commit d97038d5ec2062733c1e016caf9baaf68cf64ea1
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2023-54189
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
fs/pstore/ram_core.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/8430a8e8e85420d4cb51dcb08b0278ab194ea82f https://git.kernel.org/stable/c/a14cb307267ba7a1715403e071bdc4deda77eef5 https://git.kernel.org/stable/c/38a9d7dac3ad25323145b4aaea3b5f434f50011d https://git.kernel.org/stable/c/f57ba91a46d3fc52bfdac9cca5cf5572ec7afd6d https://git.kernel.org/stable/c/2a764a2facd9dd88a69777200f65dfd0182765dc https://git.kernel.org/stable/c/065c81ae5817b245bb9feb6d54e027702740b49a https://git.kernel.org/stable/c/d97038d5ec2062733c1e016caf9baaf68cf64ea1