In the Linux kernel, the following vulnerability has been resolved:
cpufreq: amd-pstate-ut: Fix kernel panic when loading the driver
After loading the amd-pstate-ut driver, amdpstateutcheckperf() and amdpstateutcheckfreq() use cpufreqcpuget() to get the policy of the CPU and mark it as busy.
In these functions, cpufreqcpuput() should be used to release the policy, but it is not, so any other entity trying to access the policy is blocked indefinitely.
One such scenario is when amd_pstate mode is changed, leading to the following splat:
[ 1332.103727] INFO: task bash:2929 blocked for more than 120 seconds. [ 1332.110001] Not tainted 6.5.0-rc2-amd-pstate-ut #5 [ 1332.115315] "echo 0 > /proc/sys/kernel/hungtasktimeoutsecs" disables this message. [ 1332.123140] task:bash state:D stack:0 pid:2929 ppid:2873 flags:0x00004006 [ 1332.123143] Call Trace: [ 1332.123145] <TASK> [ 1332.123148] _schedule+0x3c1/0x16a0 [ 1332.123154] ? rawreadlockirqsave+0x2d/0x70 [ 1332.123157] schedule+0x6f/0x110 [ 1332.123160] scheduletimeout+0x14f/0x160 [ 1332.123162] ? preemptcountadd+0x86/0xd0 [ 1332.123165] _waitforcommon+0x92/0x190 [ 1332.123168] ? _pfxscheduletimeout+0x10/0x10 [ 1332.123170] waitforcompletion+0x28/0x30 [ 1332.123173] cpufreqpolicyputkobj+0x4d/0x90 [ 1332.123177] cpufreqpolicyfree+0x157/0x1d0 [ 1332.123178] ? preemptcountadd+0x58/0xd0 [ 1332.123180] cpufreqremovedev+0xb6/0x100 [ 1332.123182] subsysinterfaceunregister+0x114/0x120 [ 1332.123185] ? preemptcountadd+0x58/0xd0 [ 1332.123187] ? _pfxamdpstatechangedrivermode+0x10/0x10 [ 1332.123190] cpufrequnregisterdriver+0x3b/0xd0 [ 1332.123192] amdpstatechangedrivermode+0x1e/0x50 [ 1332.123194] storestatus+0xe9/0x180 [ 1332.123197] devattrstore+0x1b/0x30 [ 1332.123199] sysfskfwrite+0x42/0x50 [ 1332.123202] kernfsfopwriteiter+0x143/0x1d0 [ 1332.123204] vfswrite+0x2df/0x400 [ 1332.123208] ksyswrite+0x6b/0xf0 [ 1332.123210] _x64syswrite+0x1d/0x30 [ 1332.123213] dosyscall64+0x60/0x90 [ 1332.123216] ? fpregsassertstateconsistent+0x2e/0x50 [ 1332.123219] ? exittousermodeprepare+0x49/0x1a0 [ 1332.123223] ? irqentryexittousermode+0xd/0x20 [ 1332.123225] ? irqentryexit+0x3f/0x50 [ 1332.123226] ? excpagefault+0x8e/0x190 [ 1332.123228] entrySYSCALL64afterhwframe+0x6e/0xd8 [ 1332.123232] RIP: 0033:0x7fa74c514a37 [ 1332.123234] RSP: 002b:00007ffe31dd0788 EFLAGS: 00000246 ORIGRAX: 0000000000000001 [ 1332.123238] RAX: ffffffffffffffda RBX: 0000000000000008 RCX: 00007fa74c514a37 [ 1332.123239] RDX: 0000000000000008 RSI: 000055e27c447aa0 RDI: 0000000000000001 [ 1332.123241] RBP: 000055e27c447aa0 R08: 00007fa74c5d1460 R09: 000000007fffffff [ 1332.123242] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000008 [ 1332.123244] R13: 00007fa74c61a780 R14: 00007fa74c616600 R15: 00007fa74c615a00 [ 1332.123247] </TASK>
Fix this by calling cpufreqcpuput() wherever necessary.
[ rjw: Subject and changelog edits ]
{
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/53xxx/CVE-2023-53563.json"
}[
{
"digest": {
"length": 1604.0,
"function_hash": "205010281733257923249582262475907894375"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@fcf78a17bbb94bebaa912f0460a1848f7d374c94",
"deprecated": false,
"id": "CVE-2023-53563-0361d1dc",
"signature_type": "Function",
"target": {
"function": "amd_pstate_ut_check_freq",
"file": "drivers/cpufreq/amd-pstate-ut.c"
},
"signature_version": "v1"
},
{
"digest": {
"length": 1604.0,
"function_hash": "205010281733257923249582262475907894375"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0f74f12ee042fd72e45f0e8700e063c84ef3883b",
"deprecated": false,
"id": "CVE-2023-53563-12b893b6",
"signature_type": "Function",
"target": {
"function": "amd_pstate_ut_check_freq",
"file": "drivers/cpufreq/amd-pstate-ut.c"
},
"signature_version": "v1"
},
{
"digest": {
"length": 1718.0,
"function_hash": "76418401149755905145573929121689570035"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@fcf78a17bbb94bebaa912f0460a1848f7d374c94",
"deprecated": false,
"id": "CVE-2023-53563-31a38493",
"signature_type": "Function",
"target": {
"function": "amd_pstate_ut_check_perf",
"file": "drivers/cpufreq/amd-pstate-ut.c"
},
"signature_version": "v1"
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"282030235731358285808668109468161721832",
"207285762149637717987465383777738413151",
"176324411439501206689154050375116163068",
"113528803612123720439799553764338881077",
"293425777447545839406421095197983677942",
"125584412424693739555346049881740549195",
"293382757422447944825053125432034303238",
"121062362565863387645852811367480268771",
"227134087426844211122231632453319938757",
"281700552464356717510023345514947846026",
"328062670875989604410888730277792953104",
"140250207077384429697477710308548068919",
"54429767232394684840672679681106443070",
"237147092453837814344959219087813632886",
"80048573219731882550042815812239397673",
"151771289695687358035195232316042101247",
"29665486497862211225752822085514153768",
"310214128722116931819873513349235448309",
"80074775180719800449146538472186451549",
"25147072885551612277334058295737395822",
"301012817687315507154996887841060999280",
"71607632287911502753429709259249300288",
"234404257010461591223401586558808254733",
"32108533968708041915596943282200550788",
"314566289838947169613278501732583600199",
"46317380461161629135166414422694852789",
"95777107131190928840906616208730013848",
"169882638824037737056658843513912339363",
"14454114632650719425362844434652172436",
"100416764673636603226980459051203257452",
"217518598046125007920316588317959185586",
"101102987674431402789963252498301575807",
"33437918597632418622869966320490889724",
"158326039901389581222044381558134907499",
"103738139019316056600380436235809965700",
"153531092459902751543264550684464960337",
"171518980264315829471785353436339692008",
"151771289695687358035195232316042101247",
"29665486497862211225752822085514153768",
"278044780833697552835943476160044876202",
"166286937080817758393112517601941869994"
]
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@fcf78a17bbb94bebaa912f0460a1848f7d374c94",
"deprecated": false,
"id": "CVE-2023-53563-55750844",
"signature_type": "Line",
"target": {
"file": "drivers/cpufreq/amd-pstate-ut.c"
},
"signature_version": "v1"
},
{
"digest": {
"length": 1604.0,
"function_hash": "205010281733257923249582262475907894375"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@84857640c67405eed258c461b3ef909002f1e201",
"deprecated": false,
"id": "CVE-2023-53563-5ed5ef39",
"signature_type": "Function",
"target": {
"function": "amd_pstate_ut_check_freq",
"file": "drivers/cpufreq/amd-pstate-ut.c"
},
"signature_version": "v1"
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"282030235731358285808668109468161721832",
"207285762149637717987465383777738413151",
"176324411439501206689154050375116163068",
"113528803612123720439799553764338881077",
"293425777447545839406421095197983677942",
"125584412424693739555346049881740549195",
"293382757422447944825053125432034303238",
"121062362565863387645852811367480268771",
"227134087426844211122231632453319938757",
"281700552464356717510023345514947846026",
"328062670875989604410888730277792953104",
"140250207077384429697477710308548068919",
"54429767232394684840672679681106443070",
"237147092453837814344959219087813632886",
"80048573219731882550042815812239397673",
"151771289695687358035195232316042101247",
"29665486497862211225752822085514153768",
"310214128722116931819873513349235448309",
"80074775180719800449146538472186451549",
"25147072885551612277334058295737395822",
"301012817687315507154996887841060999280",
"71607632287911502753429709259249300288",
"234404257010461591223401586558808254733",
"32108533968708041915596943282200550788",
"314566289838947169613278501732583600199",
"46317380461161629135166414422694852789",
"95777107131190928840906616208730013848",
"169882638824037737056658843513912339363",
"14454114632650719425362844434652172436",
"100416764673636603226980459051203257452",
"217518598046125007920316588317959185586",
"101102987674431402789963252498301575807",
"33437918597632418622869966320490889724",
"158326039901389581222044381558134907499",
"103738139019316056600380436235809965700",
"153531092459902751543264550684464960337",
"171518980264315829471785353436339692008",
"151771289695687358035195232316042101247",
"29665486497862211225752822085514153768",
"278044780833697552835943476160044876202",
"166286937080817758393112517601941869994"
]
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@60dd283804479c4a52f995b713f448e2cd65b8c8",
"deprecated": false,
"id": "CVE-2023-53563-7455a2bb",
"signature_type": "Line",
"target": {
"file": "drivers/cpufreq/amd-pstate-ut.c"
},
"signature_version": "v1"
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"282030235731358285808668109468161721832",
"207285762149637717987465383777738413151",
"176324411439501206689154050375116163068",
"113528803612123720439799553764338881077",
"293425777447545839406421095197983677942",
"125584412424693739555346049881740549195",
"293382757422447944825053125432034303238",
"121062362565863387645852811367480268771",
"227134087426844211122231632453319938757",
"281700552464356717510023345514947846026",
"328062670875989604410888730277792953104",
"140250207077384429697477710308548068919",
"54429767232394684840672679681106443070",
"237147092453837814344959219087813632886",
"80048573219731882550042815812239397673",
"151771289695687358035195232316042101247",
"29665486497862211225752822085514153768",
"310214128722116931819873513349235448309",
"80074775180719800449146538472186451549",
"25147072885551612277334058295737395822",
"301012817687315507154996887841060999280",
"71607632287911502753429709259249300288",
"234404257010461591223401586558808254733",
"32108533968708041915596943282200550788",
"314566289838947169613278501732583600199",
"46317380461161629135166414422694852789",
"95777107131190928840906616208730013848",
"169882638824037737056658843513912339363",
"14454114632650719425362844434652172436",
"100416764673636603226980459051203257452",
"217518598046125007920316588317959185586",
"101102987674431402789963252498301575807",
"33437918597632418622869966320490889724",
"158326039901389581222044381558134907499",
"103738139019316056600380436235809965700",
"153531092459902751543264550684464960337",
"171518980264315829471785353436339692008",
"151771289695687358035195232316042101247",
"29665486497862211225752822085514153768",
"278044780833697552835943476160044876202",
"166286937080817758393112517601941869994"
]
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@84857640c67405eed258c461b3ef909002f1e201",
"deprecated": false,
"id": "CVE-2023-53563-8fc44301",
"signature_type": "Line",
"target": {
"file": "drivers/cpufreq/amd-pstate-ut.c"
},
"signature_version": "v1"
},
{
"digest": {
"length": 1718.0,
"function_hash": "76418401149755905145573929121689570035"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@84857640c67405eed258c461b3ef909002f1e201",
"deprecated": false,
"id": "CVE-2023-53563-b1b23583",
"signature_type": "Function",
"target": {
"function": "amd_pstate_ut_check_perf",
"file": "drivers/cpufreq/amd-pstate-ut.c"
},
"signature_version": "v1"
},
{
"digest": {
"length": 1718.0,
"function_hash": "76418401149755905145573929121689570035"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0f74f12ee042fd72e45f0e8700e063c84ef3883b",
"deprecated": false,
"id": "CVE-2023-53563-ca4d5f38",
"signature_type": "Function",
"target": {
"function": "amd_pstate_ut_check_perf",
"file": "drivers/cpufreq/amd-pstate-ut.c"
},
"signature_version": "v1"
},
{
"digest": {
"length": 1604.0,
"function_hash": "205010281733257923249582262475907894375"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@60dd283804479c4a52f995b713f448e2cd65b8c8",
"deprecated": false,
"id": "CVE-2023-53563-d42376d8",
"signature_type": "Function",
"target": {
"function": "amd_pstate_ut_check_freq",
"file": "drivers/cpufreq/amd-pstate-ut.c"
},
"signature_version": "v1"
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"282030235731358285808668109468161721832",
"207285762149637717987465383777738413151",
"176324411439501206689154050375116163068",
"113528803612123720439799553764338881077",
"293425777447545839406421095197983677942",
"125584412424693739555346049881740549195",
"293382757422447944825053125432034303238",
"121062362565863387645852811367480268771",
"227134087426844211122231632453319938757",
"281700552464356717510023345514947846026",
"328062670875989604410888730277792953104",
"140250207077384429697477710308548068919",
"54429767232394684840672679681106443070",
"237147092453837814344959219087813632886",
"80048573219731882550042815812239397673",
"151771289695687358035195232316042101247",
"29665486497862211225752822085514153768",
"310214128722116931819873513349235448309",
"80074775180719800449146538472186451549",
"25147072885551612277334058295737395822",
"301012817687315507154996887841060999280",
"71607632287911502753429709259249300288",
"234404257010461591223401586558808254733",
"32108533968708041915596943282200550788",
"314566289838947169613278501732583600199",
"46317380461161629135166414422694852789",
"95777107131190928840906616208730013848",
"169882638824037737056658843513912339363",
"14454114632650719425362844434652172436",
"100416764673636603226980459051203257452",
"217518598046125007920316588317959185586",
"101102987674431402789963252498301575807",
"33437918597632418622869966320490889724",
"158326039901389581222044381558134907499",
"103738139019316056600380436235809965700",
"153531092459902751543264550684464960337",
"171518980264315829471785353436339692008",
"151771289695687358035195232316042101247",
"29665486497862211225752822085514153768",
"278044780833697552835943476160044876202",
"166286937080817758393112517601941869994"
]
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0f74f12ee042fd72e45f0e8700e063c84ef3883b",
"deprecated": false,
"id": "CVE-2023-53563-f4d7ed0e",
"signature_type": "Line",
"target": {
"file": "drivers/cpufreq/amd-pstate-ut.c"
},
"signature_version": "v1"
},
{
"digest": {
"length": 1718.0,
"function_hash": "76418401149755905145573929121689570035"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@60dd283804479c4a52f995b713f448e2cd65b8c8",
"deprecated": false,
"id": "CVE-2023-53563-f9ef405b",
"signature_type": "Function",
"target": {
"function": "amd_pstate_ut_check_perf",
"file": "drivers/cpufreq/amd-pstate-ut.c"
},
"signature_version": "v1"
}
]
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-53563.json"