In the Linux kernel, the following vulnerability has been resolved:
crypto: pcrypt - Fix hungtask for PADATA_RESET
We found a hungtask bug in testaeadvec_cfg as follows:
INFO: task cryptomgrtest:391009 blocked for more than 120 seconds. "echo 0 > /proc/sys/kernel/hungtasktimeoutsecs" disables this message. Call trace: _switchto+0x98/0xe0 _schedule+0x6c4/0xf40 schedule+0xd8/0x1b4 scheduletimeout+0x474/0x560 waitforcommon+0x368/0x4e0 waitforcompletion+0x20/0x30 waitforcompletion+0x20/0x30 testaeadveccfg+0xab4/0xd50 testaead+0x144/0x1f0 algtestaead+0xd8/0x1e0 algtest+0x634/0x890 cryptomgrtest+0x40/0x70 kthread+0x1e0/0x220 retfromfork+0x10/0x18 Kernel panic - not syncing: hung_task: blocked tasks
For padatadoparallel, when the return err is 0 or -EBUSY, it will call waitforcompletion(&wait->completion) in testaeadveccfg. In normal case, aeadrequestcomplete() will be called in pcryptaeadserial and the return err is 0 for padatadoparallel. But, when pinst->flags is PADATARESET, the return err is -EBUSY for padatadoparallel, and it won't call aeadrequestcomplete(). Therefore, testaeadveccfg will hung at waitfor_completion(&wait->completion), which will cause hungtask.
The problem comes as following: (padatadoparallel) | rcureadlockbh(); | err = -EINVAL; | (padatareplace) | pinst->flags |= PADATARESET; err = -EBUSY | if (pinst->flags & PADATARESET) | rcureadunlock_bh() | return err
In order to resolve the problem, we replace the return err -EBUSY with -EAGAIN, which means parallel_data is changing, and the caller should call it again.
v3: remove retry and just change the return err. v2: introduce padatatrydoparallel() in pcryptaeadencrypt and pcryptaead_decrypt to solve the hungtask.
{
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/52xxx/CVE-2023-52813.json"
}"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-52813.json"
[
{
"signature_type": "Line",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e97bf4ada7dddacd184c3e196bd063b0dc71b41d",
"digest": {
"line_hashes": [
"271355314635903892381271702576311611703",
"193777928545415260162722962156958571488",
"332323691028175870407049690031183708635",
"49371449643575209886305814271773923719",
"245192494053975208174008397236657446734",
"249695340567295656376396635330865734293",
"332323691028175870407049690031183708635",
"226561118763661949169023474440618283662"
],
"threshold": 0.9
},
"id": "CVE-2023-52813-018740d7",
"deprecated": false,
"target": {
"file": "crypto/pcrypt.c"
}
},
{
"signature_type": "Function",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@372636debe852913529b1716f44addd94fff2d28",
"digest": {
"function_hash": "89863619838906357733328632511737576936",
"length": 754.0
},
"id": "CVE-2023-52813-2100e67f",
"deprecated": false,
"target": {
"file": "crypto/pcrypt.c",
"function": "pcrypt_aead_encrypt"
}
},
{
"signature_type": "Line",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@fb2d3a50a8f29a3c66682bb426144f40e32ab818",
"digest": {
"line_hashes": [
"5238982825844349708590772164452402960",
"114697260492170345853861706687571627617",
"332323691028175870407049690031183708635",
"49371449643575209886305814271773923719",
"148265281936500771532629880422081536066",
"88362621954607999267046918250584835475",
"332323691028175870407049690031183708635",
"226561118763661949169023474440618283662"
],
"threshold": 0.9
},
"id": "CVE-2023-52813-336dad4e",
"deprecated": false,
"target": {
"file": "crypto/pcrypt.c"
}
},
{
"signature_type": "Function",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8f4f68e788c3a7a696546291258bfa5fdb215523",
"digest": {
"function_hash": "52104823665082570824822487464034612011",
"length": 754.0
},
"id": "CVE-2023-52813-4cd5a3ca",
"deprecated": false,
"target": {
"file": "crypto/pcrypt.c",
"function": "pcrypt_aead_decrypt"
}
},
{
"signature_type": "Function",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8f4f68e788c3a7a696546291258bfa5fdb215523",
"digest": {
"function_hash": "89863619838906357733328632511737576936",
"length": 754.0
},
"id": "CVE-2023-52813-568ca697",
"deprecated": false,
"target": {
"file": "crypto/pcrypt.c",
"function": "pcrypt_aead_encrypt"
}
},
{
"signature_type": "Function",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e97bf4ada7dddacd184c3e196bd063b0dc71b41d",
"digest": {
"function_hash": "89863619838906357733328632511737576936",
"length": 754.0
},
"id": "CVE-2023-52813-58432a43",
"deprecated": false,
"target": {
"file": "crypto/pcrypt.c",
"function": "pcrypt_aead_encrypt"
}
},
{
"signature_type": "Line",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@372636debe852913529b1716f44addd94fff2d28",
"digest": {
"line_hashes": [
"271355314635903892381271702576311611703",
"193777928545415260162722962156958571488",
"332323691028175870407049690031183708635",
"49371449643575209886305814271773923719",
"245192494053975208174008397236657446734",
"249695340567295656376396635330865734293",
"332323691028175870407049690031183708635",
"226561118763661949169023474440618283662"
],
"threshold": 0.9
},
"id": "CVE-2023-52813-787553d4",
"deprecated": false,
"target": {
"file": "crypto/pcrypt.c"
}
},
{
"signature_type": "Function",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@372636debe852913529b1716f44addd94fff2d28",
"digest": {
"function_hash": "52104823665082570824822487464034612011",
"length": 754.0
},
"id": "CVE-2023-52813-862fd313",
"deprecated": false,
"target": {
"file": "crypto/pcrypt.c",
"function": "pcrypt_aead_decrypt"
}
},
{
"signature_type": "Function",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@fb2d3a50a8f29a3c66682bb426144f40e32ab818",
"digest": {
"function_hash": "24983966643772038028441203924820198883",
"length": 713.0
},
"id": "CVE-2023-52813-8fcdb146",
"deprecated": false,
"target": {
"file": "crypto/pcrypt.c",
"function": "pcrypt_aead_encrypt"
}
},
{
"signature_type": "Function",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e97bf4ada7dddacd184c3e196bd063b0dc71b41d",
"digest": {
"function_hash": "52104823665082570824822487464034612011",
"length": 754.0
},
"id": "CVE-2023-52813-b3c14f61",
"deprecated": false,
"target": {
"file": "crypto/pcrypt.c",
"function": "pcrypt_aead_decrypt"
}
},
{
"signature_type": "Function",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@fb2d3a50a8f29a3c66682bb426144f40e32ab818",
"digest": {
"function_hash": "238374903708994763589376962752905130877",
"length": 713.0
},
"id": "CVE-2023-52813-c5cf94a6",
"deprecated": false,
"target": {
"file": "crypto/pcrypt.c",
"function": "pcrypt_aead_decrypt"
}
},
{
"signature_type": "Line",
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8f4f68e788c3a7a696546291258bfa5fdb215523",
"digest": {
"line_hashes": [
"271355314635903892381271702576311611703",
"193777928545415260162722962156958571488",
"332323691028175870407049690031183708635",
"49371449643575209886305814271773923719",
"245192494053975208174008397236657446734",
"249695340567295656376396635330865734293",
"332323691028175870407049690031183708635",
"226561118763661949169023474440618283662"
],
"threshold": 0.9
},
"id": "CVE-2023-52813-ea100813",
"deprecated": false,
"target": {
"file": "crypto/pcrypt.c"
}
}
]