In the Linux kernel, the following vulnerability has been resolved:
drm/amd/display: Fix a NULL pointer dereference in amdgpudmconnectoraddcommon_modes()
In amdgpudmconnectoraddcommonmodes(), amdgpudmcreatecommonmode() is assigned to mode and is passed to drmmodeprobedadd() directly after that. drmmodeprobedadd() passes &mode->head to listaddtail(), and there is a dereference of it in listaddtail() without recoveries, which could lead to NULL pointer dereference on failure of amdgpudmcreatecommon_mode().
Fix this by adding a NULL check of mode.
This bug was found by a static analyzer.
Builds with 'make allyesconfig' show no new warnings, and our static analyzer no longer warns about this code.
[
{
"signature_type": "Function",
"digest": {
"function_hash": "250773800961584692850522925388864104219",
"length": 1232.0
},
"target": {
"file": "drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c",
"function": "amdgpu_dm_connector_add_common_modes"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@588a70177df3b1777484267584ef38ab2ca899a2",
"id": "CVE-2022-49232-19e482e0",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "250773800961584692850522925388864104219",
"length": 1232.0
},
"target": {
"file": "drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c",
"function": "amdgpu_dm_connector_add_common_modes"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@19a7eba284790cfbba2945deb2363cf03ce41648",
"id": "CVE-2022-49232-23d66a34",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "250773800961584692850522925388864104219",
"length": 1232.0
},
"target": {
"file": "drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c",
"function": "amdgpu_dm_connector_add_common_modes"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@639b3b9def0a6a3f316a195d705d14113236e89c",
"id": "CVE-2022-49232-2a614416",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"17546573112486502829439729576399337979",
"193975279292997478977797219213906598827",
"276669701542312405758004836473987753758",
"176837532287239483934331692388826429785"
]
},
"target": {
"file": "drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@588a70177df3b1777484267584ef38ab2ca899a2",
"id": "CVE-2022-49232-2eebcd0b",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "250773800961584692850522925388864104219",
"length": 1232.0
},
"target": {
"file": "drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c",
"function": "amdgpu_dm_connector_add_common_modes"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bdc7429708a0772d90c208975694f7c2133b1202",
"id": "CVE-2022-49232-3971cb76",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "250773800961584692850522925388864104219",
"length": 1232.0
},
"target": {
"file": "drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c",
"function": "amdgpu_dm_connector_add_common_modes"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@57f4ad5e286fe4599c8fc63cf89f85f9eec7f9c9",
"id": "CVE-2022-49232-3c1b7563",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"17546573112486502829439729576399337979",
"193975279292997478977797219213906598827",
"276669701542312405758004836473987753758",
"176837532287239483934331692388826429785"
]
},
"target": {
"file": "drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bdc7429708a0772d90c208975694f7c2133b1202",
"id": "CVE-2022-49232-56f16c51",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"17546573112486502829439729576399337979",
"193975279292997478977797219213906598827",
"276669701542312405758004836473987753758",
"176837532287239483934331692388826429785"
]
},
"target": {
"file": "drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2c729dec8c1e3e2892fde5ce8181553860914e74",
"id": "CVE-2022-49232-58bea53a",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "250773800961584692850522925388864104219",
"length": 1232.0
},
"target": {
"file": "drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c",
"function": "amdgpu_dm_connector_add_common_modes"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2c729dec8c1e3e2892fde5ce8181553860914e74",
"id": "CVE-2022-49232-6448dfbd",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"17546573112486502829439729576399337979",
"193975279292997478977797219213906598827",
"276669701542312405758004836473987753758",
"176837532287239483934331692388826429785"
]
},
"target": {
"file": "drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@639b3b9def0a6a3f316a195d705d14113236e89c",
"id": "CVE-2022-49232-78596aeb",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"17546573112486502829439729576399337979",
"193975279292997478977797219213906598827",
"276669701542312405758004836473987753758",
"176837532287239483934331692388826429785"
]
},
"target": {
"file": "drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f4eaa999fec78dec2a9c2d797438e05cbffb125b",
"id": "CVE-2022-49232-b7e64078",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "250773800961584692850522925388864104219",
"length": 1232.0
},
"target": {
"file": "drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c",
"function": "amdgpu_dm_connector_add_common_modes"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f4eaa999fec78dec2a9c2d797438e05cbffb125b",
"id": "CVE-2022-49232-cd9fe581",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"17546573112486502829439729576399337979",
"193975279292997478977797219213906598827",
"276669701542312405758004836473987753758",
"176837532287239483934331692388826429785"
]
},
"target": {
"file": "drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@19a7eba284790cfbba2945deb2363cf03ce41648",
"id": "CVE-2022-49232-e1c9526e",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"17546573112486502829439729576399337979",
"193975279292997478977797219213906598827",
"276669701542312405758004836473987753758",
"176837532287239483934331692388826429785"
]
},
"target": {
"file": "drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@57f4ad5e286fe4599c8fc63cf89f85f9eec7f9c9",
"id": "CVE-2022-49232-f1c4938f",
"deprecated": false,
"signature_version": "v1"
}
]