In the Linux kernel, the following vulnerability has been resolved:
drm/amd/display: Add 'replay' NULL check in 'edpsetreplayallowactive()'
In the first if statement, we're checking if 'replay' is NULL. But in the second if statement, we're not checking if 'replay' is NULL again before calling replay->funcs->replaysetpower_opt().
if (replay == NULL && force_static) return false;
...
if (link->replaysettings.replayfeatureenabled && replay->funcs->replaysetpoweropt) { replay->funcs->replaysetpoweropt(replay, *poweropts, panelinst); link->replaysettings.replaypoweroptactive = *poweropts; }
If 'replay' is NULL, this will cause a null pointer dereference.
Fixes the below found by smatch: drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/linkedppanelcontrol.c:895 edpsetreplayallow_active() error: we previously assumed 'replay' could be null (see line 887)
[
{
"signature_type": "Line",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f610c46771ef1047e46d61807aa7c69cd29e63d8",
"digest": {
"line_hashes": [
"79120873325904312306235979798142095209",
"143208364289748842968342241170399040889",
"257860781515914042957347249594788809880",
"203212367251652195645332135570115276683"
],
"threshold": 0.9
},
"id": "CVE-2024-27040-2d9e25e0"
},
{
"signature_type": "Line",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e7cadd5d3a8ffe334d0229ba9eda4290138d56e7",
"digest": {
"line_hashes": [
"79120873325904312306235979798142095209",
"143208364289748842968342241170399040889",
"257860781515914042957347249594788809880",
"203212367251652195645332135570115276683"
],
"threshold": 0.9
},
"id": "CVE-2024-27040-4115e4ab"
},
{
"signature_type": "Function",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c",
"function": "edp_set_replay_allow_active"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f610c46771ef1047e46d61807aa7c69cd29e63d8",
"digest": {
"length": 909.0,
"function_hash": "250328450926169030591668149283632055511"
},
"id": "CVE-2024-27040-73e77a8c"
},
{
"signature_type": "Function",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c",
"function": "edp_set_replay_allow_active"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d0e94f4807ff0df66cf447d6b4bbb8ac830e99c3",
"digest": {
"length": 909.0,
"function_hash": "250328450926169030591668149283632055511"
},
"id": "CVE-2024-27040-8fe48163"
},
{
"signature_type": "Line",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d0e94f4807ff0df66cf447d6b4bbb8ac830e99c3",
"digest": {
"line_hashes": [
"79120873325904312306235979798142095209",
"143208364289748842968342241170399040889",
"257860781515914042957347249594788809880",
"203212367251652195645332135570115276683"
],
"threshold": 0.9
},
"id": "CVE-2024-27040-9b9416cb"
},
{
"signature_type": "Function",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c",
"function": "edp_set_replay_allow_active"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e7cadd5d3a8ffe334d0229ba9eda4290138d56e7",
"digest": {
"length": 909.0,
"function_hash": "250328450926169030591668149283632055511"
},
"id": "CVE-2024-27040-aa1ec187"
},
{
"signature_type": "Function",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c",
"function": "edp_set_replay_allow_active"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f6aed043ee5d75b3d1bfc452b1a9584b63c8f76b",
"digest": {
"length": 909.0,
"function_hash": "250328450926169030591668149283632055511"
},
"id": "CVE-2024-27040-b7dcb806"
},
{
"signature_type": "Line",
"deprecated": false,
"signature_version": "v1",
"target": {
"file": "drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f6aed043ee5d75b3d1bfc452b1a9584b63c8f76b",
"digest": {
"line_hashes": [
"79120873325904312306235979798142095209",
"143208364289748842968342241170399040889",
"257860781515914042957347249594788809880",
"203212367251652195645332135570115276683"
],
"threshold": 0.9
},
"id": "CVE-2024-27040-fe668b74"
}
]