In the Linux kernel, the following vulnerability has been resolved:
drm/msm: Avoid NULL dereference in msmdispstateprintregs()
If the allocation in msmdispstatedumpregs() failed then
block->state
can be NULL. The msmdispstateprintregs() 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
msmdispstateprintregs() not to pointlessly take a double-pointer
and properly mark the pointer as const
.
Patchwork: https://patchwork.freedesktop.org/patch/619657/
[ { "signature_type": "Line", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@563aa81fd66a4e7e6e551a0e02bcc23957cafe2f", "signature_version": "v1", "target": { "file": "drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "224518510896964935230015170545563569337", "245158219073580158626360683950984800870", "292903558347538998287969815231028879783", "319295855186558882031127037548688550104", "213165112414018038261336520211422127135", "245747039528080273063467964731542741320", "80789098670991163951704120263731497031", "190426964992585522014442171021748402291", "244387867092303999451097423842420703108", "208801887525929792648758885524581956532", "76949038217208054043904920362951855782", "300011086009176484764393319203302944422", "295716617615087999089953230660663912140", "236522104207965799212547774715295386624", "278358875827003336795136927670153794187", "32553514488210829625166883344383617651", "235643181883011844114682541181743813347", "225935540937837742532044754366465894349" ] }, "id": "CVE-2024-50156-237328bb" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@42cf045086feae77b212f0f66e742b91a5b566b7", "signature_version": "v1", "target": { "function": "msm_disp_state_print_regs", "file": "drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c" }, "digest": { "function_hash": "240348546002792849530870488567846529584", "length": 467.0 }, "id": "CVE-2024-50156-2787895e" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@293f53263266bc4340d777268ab4328a97f041fa", "signature_version": "v1", "target": { "function": "msm_disp_state_print_regs", "file": "drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c" }, "digest": { "function_hash": "240348546002792849530870488567846529584", "length": 467.0 }, "id": "CVE-2024-50156-43b8efa1" }, { "signature_type": "Line", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e8e9f2a12a6214080c8ea83220a596f6e1dedc6c", "signature_version": "v1", "target": { "file": "drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "224518510896964935230015170545563569337", "245158219073580158626360683950984800870", "292903558347538998287969815231028879783", "319295855186558882031127037548688550104", "213165112414018038261336520211422127135", "245747039528080273063467964731542741320", "80789098670991163951704120263731497031", "190426964992585522014442171021748402291", "244387867092303999451097423842420703108", "208801887525929792648758885524581956532", "76949038217208054043904920362951855782", "300011086009176484764393319203302944422", "295716617615087999089953230660663912140", "236522104207965799212547774715295386624", "278358875827003336795136927670153794187", "32553514488210829625166883344383617651", "235643181883011844114682541181743813347", "225935540937837742532044754366465894349" ] }, "id": "CVE-2024-50156-52a4c85e" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e8e9f2a12a6214080c8ea83220a596f6e1dedc6c", "signature_version": "v1", "target": { "function": "msm_disp_state_print_regs", "file": "drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c" }, "digest": { "function_hash": "240348546002792849530870488567846529584", "length": 467.0 }, "id": "CVE-2024-50156-60c23066" }, { "signature_type": "Line", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@42cf045086feae77b212f0f66e742b91a5b566b7", "signature_version": "v1", "target": { "file": "drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "224518510896964935230015170545563569337", "245158219073580158626360683950984800870", "292903558347538998287969815231028879783", "319295855186558882031127037548688550104", "213165112414018038261336520211422127135", "245747039528080273063467964731542741320", "80789098670991163951704120263731497031", "190426964992585522014442171021748402291", "244387867092303999451097423842420703108", "208801887525929792648758885524581956532", "76949038217208054043904920362951855782", "300011086009176484764393319203302944422", "295716617615087999089953230660663912140", "236522104207965799212547774715295386624", "135376605065761517720410350100351937131", "32553514488210829625166883344383617651", "235643181883011844114682541181743813347", "225935540937837742532044754366465894349" ] }, "id": "CVE-2024-50156-650e5f51" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@563aa81fd66a4e7e6e551a0e02bcc23957cafe2f", "signature_version": "v1", "target": { "function": "msm_disp_state_print", "file": "drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c" }, "digest": { "function_hash": "228672380424624575461153864369137748231", "length": 786.0 }, "id": "CVE-2024-50156-78d52c58" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e8e9f2a12a6214080c8ea83220a596f6e1dedc6c", "signature_version": "v1", "target": { "function": "msm_disp_state_print", "file": "drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c" }, "digest": { "function_hash": "228672380424624575461153864369137748231", "length": 786.0 }, "id": "CVE-2024-50156-841c0958" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@42cf045086feae77b212f0f66e742b91a5b566b7", "signature_version": "v1", "target": { "function": "msm_disp_state_print", "file": "drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c" }, "digest": { "function_hash": "319967153063477104949556705155238217727", "length": 716.0 }, "id": "CVE-2024-50156-90a8666f" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f7ad916273483748582d97cfa31054ccb19224f3", "signature_version": "v1", "target": { "function": "msm_disp_state_print", "file": "drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c" }, "digest": { "function_hash": "228672380424624575461153864369137748231", "length": 786.0 }, "id": "CVE-2024-50156-9d6b0957" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@563aa81fd66a4e7e6e551a0e02bcc23957cafe2f", "signature_version": "v1", "target": { "function": "msm_disp_state_print_regs", "file": "drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c" }, "digest": { "function_hash": "240348546002792849530870488567846529584", "length": 467.0 }, "id": "CVE-2024-50156-afe8ea96" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f7ad916273483748582d97cfa31054ccb19224f3", "signature_version": "v1", "target": { "function": "msm_disp_state_print_regs", "file": "drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c" }, "digest": { "function_hash": "240348546002792849530870488567846529584", "length": 467.0 }, "id": "CVE-2024-50156-d9c2120b" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@293f53263266bc4340d777268ab4328a97f041fa", "signature_version": "v1", "target": { "function": "msm_disp_state_print", "file": "drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c" }, "digest": { "function_hash": "228672380424624575461153864369137748231", "length": 786.0 }, "id": "CVE-2024-50156-dfda080c" }, { "signature_type": "Line", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f7ad916273483748582d97cfa31054ccb19224f3", "signature_version": "v1", "target": { "file": "drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "224518510896964935230015170545563569337", "245158219073580158626360683950984800870", "292903558347538998287969815231028879783", "319295855186558882031127037548688550104", "213165112414018038261336520211422127135", "245747039528080273063467964731542741320", "80789098670991163951704120263731497031", "190426964992585522014442171021748402291", "244387867092303999451097423842420703108", "208801887525929792648758885524581956532", "76949038217208054043904920362951855782", "300011086009176484764393319203302944422", "295716617615087999089953230660663912140", "236522104207965799212547774715295386624", "278358875827003336795136927670153794187", "32553514488210829625166883344383617651", "235643181883011844114682541181743813347", "225935540937837742532044754366465894349" ] }, "id": "CVE-2024-50156-ec4ddb1a" }, { "signature_type": "Line", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@293f53263266bc4340d777268ab4328a97f041fa", "signature_version": "v1", "target": { "file": "drivers/gpu/drm/msm/disp/msm_disp_snapshot_util.c" }, "digest": { "threshold": 0.9, "line_hashes": [ "224518510896964935230015170545563569337", "245158219073580158626360683950984800870", "292903558347538998287969815231028879783", "319295855186558882031127037548688550104", "213165112414018038261336520211422127135", "245747039528080273063467964731542741320", "80789098670991163951704120263731497031", "190426964992585522014442171021748402291", "244387867092303999451097423842420703108", "208801887525929792648758885524581956532", "76949038217208054043904920362951855782", "300011086009176484764393319203302944422", "295716617615087999089953230660663912140", "236522104207965799212547774715295386624", "278358875827003336795136927670153794187", "32553514488210829625166883344383617651", "235643181883011844114682541181743813347", "225935540937837742532044754366465894349" ] }, "id": "CVE-2024-50156-fce6f3e2" } ]