CVE-2024-50156 drm/msm: Avoid NULL dereference in msm_disp_state_print_regs()

Medium 5.5 Published Updated

A NULL pointer dereference in the Linux kernel's MSM display driver can cause a system crash when register allocation fails.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2024-50156?

CVE-2024-50156 is a medium-severity vulnerability in Linux kernel, published on 7 Nov 2024. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

In the Linux kernel, the following vulnerability has been resolved:

drm/msm: Avoid NULL dereference in msm_disp_state_print_regs()

If the allocation in msm_disp_state_dump_regs() failed then `block->state` can be NULL. The msm_disp_state_print_regs() function _does_ have code to try to handle it with:

if (*reg) dump_addr = *reg;

...but since "dump_addr" is initialized to NULL the above is actually a noop. The code then goes on to dereference `dump_addr`.

Make the function print "Registers not stored" when it sees a NULL to solve this. Since we're touching the code, fix msm_disp_state_print_regs() not to pointlessly take a double-pointer and properly mark the pointer as `const`.

Patchwork: https://patchwork.freedesktop.org/patch/619657/

Weakness: CWE-476

Which versions are affected by CVE-2024-50156?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2024-50156?

Apply the vendor's patch.

Is CVE-2024-50156 being exploited?

There is no known exploitation of CVE-2024-50156 in the wild and no public exploit code.

All Linux kernel vulnerabilities

Sources

Also known as AZL-53268, AZL-53385, BELL-CVE-2024-50156, DEBIAN-CVE-2024-50156, GHSA-wpfc-gx92-f98v, UBUNTU-CVE-2024-50156.

Is CVE-2024-50156 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free