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.
[ { "deprecated": false, "target": { "file": "crypto/pcrypt.c" }, "signature_type": "Line", "id": "CVE-2023-52813-018740d7", "digest": { "line_hashes": [ "271355314635903892381271702576311611703", "193777928545415260162722962156958571488", "332323691028175870407049690031183708635", "49371449643575209886305814271773923719", "245192494053975208174008397236657446734", "249695340567295656376396635330865734293", "332323691028175870407049690031183708635", "226561118763661949169023474440618283662" ], "threshold": 0.9 }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e97bf4ada7dddacd184c3e196bd063b0dc71b41d", "signature_version": "v1" }, { "deprecated": false, "target": { "file": "crypto/pcrypt.c" }, "signature_type": "Line", "id": "CVE-2023-52813-1d1750e8", "digest": { "line_hashes": [ "271355314635903892381271702576311611703", "193777928545415260162722962156958571488", "332323691028175870407049690031183708635", "49371449643575209886305814271773923719", "245192494053975208174008397236657446734", "249695340567295656376396635330865734293", "332323691028175870407049690031183708635", "226561118763661949169023474440618283662" ], "threshold": 0.9 }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@546c1796ad1ed0d87dab3c4b5156d75819be2316", "signature_version": "v1" }, { "deprecated": false, "target": { "file": "crypto/pcrypt.c", "function": "pcrypt_aead_encrypt" }, "signature_type": "Function", "id": "CVE-2023-52813-2100e67f", "digest": { "length": 754.0, "function_hash": "89863619838906357733328632511737576936" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@372636debe852913529b1716f44addd94fff2d28", "signature_version": "v1" }, { "deprecated": false, "target": { "file": "crypto/pcrypt.c", "function": "pcrypt_aead_encrypt" }, "signature_type": "Function", "id": "CVE-2023-52813-2e9cd861", "digest": { "length": 754.0, "function_hash": "89863619838906357733328632511737576936" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c55fc098fd9d2dca475b82d00ffbcaf97879d77e", "signature_version": "v1" }, { "deprecated": false, "target": { "file": "crypto/pcrypt.c" }, "signature_type": "Line", "id": "CVE-2023-52813-336dad4e", "digest": { "line_hashes": [ "5238982825844349708590772164452402960", "114697260492170345853861706687571627617", "332323691028175870407049690031183708635", "49371449643575209886305814271773923719", "148265281936500771532629880422081536066", "88362621954607999267046918250584835475", "332323691028175870407049690031183708635", "226561118763661949169023474440618283662" ], "threshold": 0.9 }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@fb2d3a50a8f29a3c66682bb426144f40e32ab818", "signature_version": "v1" }, { "deprecated": false, "target": { "file": "crypto/pcrypt.c" }, "signature_type": "Line", "id": "CVE-2023-52813-3656134b", "digest": { "line_hashes": [ "271355314635903892381271702576311611703", "193777928545415260162722962156958571488", "332323691028175870407049690031183708635", "49371449643575209886305814271773923719", "245192494053975208174008397236657446734", "249695340567295656376396635330865734293", "332323691028175870407049690031183708635", "226561118763661949169023474440618283662" ], "threshold": 0.9 }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c9c1334697301c10e6918d747ed38abfbc0c96e7", "signature_version": "v1" }, { "deprecated": false, "target": { "file": "crypto/pcrypt.c", "function": "pcrypt_aead_decrypt" }, "signature_type": "Function", "id": "CVE-2023-52813-4cd5a3ca", "digest": { "length": 754.0, "function_hash": "52104823665082570824822487464034612011" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8f4f68e788c3a7a696546291258bfa5fdb215523", "signature_version": "v1" }, { "deprecated": false, "target": { "file": "crypto/pcrypt.c", "function": "pcrypt_aead_encrypt" }, "signature_type": "Function", "id": "CVE-2023-52813-568ca697", "digest": { "length": 754.0, "function_hash": "89863619838906357733328632511737576936" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8f4f68e788c3a7a696546291258bfa5fdb215523", "signature_version": "v1" }, { "deprecated": false, "target": { "file": "crypto/pcrypt.c", "function": "pcrypt_aead_encrypt" }, "signature_type": "Function", "id": "CVE-2023-52813-58432a43", "digest": { "length": 754.0, "function_hash": "89863619838906357733328632511737576936" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e97bf4ada7dddacd184c3e196bd063b0dc71b41d", "signature_version": "v1" }, { "deprecated": false, "target": { "file": "crypto/pcrypt.c", "function": "pcrypt_aead_encrypt" }, "signature_type": "Function", "id": "CVE-2023-52813-5d949df5", "digest": { "length": 713.0, "function_hash": "24983966643772038028441203924820198883" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@039fec48e062504f14845124a1a25eb199b2ddc0", "signature_version": "v1" }, { "deprecated": false, "target": { "file": "crypto/pcrypt.c" }, "signature_type": "Line", "id": "CVE-2023-52813-5e65b52f", "digest": { "line_hashes": [ "271355314635903892381271702576311611703", "193777928545415260162722962156958571488", "332323691028175870407049690031183708635", "49371449643575209886305814271773923719", "245192494053975208174008397236657446734", "249695340567295656376396635330865734293", "332323691028175870407049690031183708635", "226561118763661949169023474440618283662" ], "threshold": 0.9 }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e134f3aba98e6c801a693f540912c2d493718ddf", "signature_version": "v1" }, { "deprecated": false, "target": { "file": "crypto/pcrypt.c", "function": "pcrypt_aead_decrypt" }, "signature_type": "Function", "id": "CVE-2023-52813-6aecbc50", "digest": { "length": 754.0, "function_hash": "52104823665082570824822487464034612011" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e134f3aba98e6c801a693f540912c2d493718ddf", "signature_version": "v1" }, { "deprecated": false, "target": { "file": "crypto/pcrypt.c", "function": "pcrypt_aead_decrypt" }, "signature_type": "Function", "id": "CVE-2023-52813-6b407d27", "digest": { "length": 754.0, "function_hash": "52104823665082570824822487464034612011" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c9c1334697301c10e6918d747ed38abfbc0c96e7", "signature_version": "v1" }, { "deprecated": false, "target": { "file": "crypto/pcrypt.c" }, "signature_type": "Line", "id": "CVE-2023-52813-787553d4", "digest": { "line_hashes": [ "271355314635903892381271702576311611703", "193777928545415260162722962156958571488", "332323691028175870407049690031183708635", "49371449643575209886305814271773923719", "245192494053975208174008397236657446734", "249695340567295656376396635330865734293", "332323691028175870407049690031183708635", "226561118763661949169023474440618283662" ], "threshold": 0.9 }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@372636debe852913529b1716f44addd94fff2d28", "signature_version": "v1" }, { "deprecated": false, "target": { "file": "crypto/pcrypt.c", "function": "pcrypt_aead_encrypt" }, "signature_type": "Function", "id": "CVE-2023-52813-7c30e23f", "digest": { "length": 754.0, "function_hash": "89863619838906357733328632511737576936" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@546c1796ad1ed0d87dab3c4b5156d75819be2316", "signature_version": "v1" }, { "deprecated": false, "target": { "file": "crypto/pcrypt.c", "function": "pcrypt_aead_decrypt" }, "signature_type": "Function", "id": "CVE-2023-52813-862fd313", "digest": { "length": 754.0, "function_hash": "52104823665082570824822487464034612011" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@372636debe852913529b1716f44addd94fff2d28", "signature_version": "v1" }, { "deprecated": false, "target": { "file": "crypto/pcrypt.c", "function": "pcrypt_aead_encrypt" }, "signature_type": "Function", "id": "CVE-2023-52813-8a5922be", "digest": { "length": 754.0, "function_hash": "89863619838906357733328632511737576936" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e134f3aba98e6c801a693f540912c2d493718ddf", "signature_version": "v1" }, { "deprecated": false, "target": { "file": "crypto/pcrypt.c", "function": "pcrypt_aead_encrypt" }, "signature_type": "Function", "id": "CVE-2023-52813-8fcdb146", "digest": { "length": 713.0, "function_hash": "24983966643772038028441203924820198883" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@fb2d3a50a8f29a3c66682bb426144f40e32ab818", "signature_version": "v1" }, { "deprecated": false, "target": { "file": "crypto/pcrypt.c", "function": "pcrypt_aead_decrypt" }, "signature_type": "Function", "id": "CVE-2023-52813-a2fbc30b", "digest": { "length": 754.0, "function_hash": "52104823665082570824822487464034612011" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@546c1796ad1ed0d87dab3c4b5156d75819be2316", "signature_version": "v1" }, { "deprecated": false, "target": { "file": "crypto/pcrypt.c" }, "signature_type": "Line", "id": "CVE-2023-52813-b0c09744", "digest": { "line_hashes": [ "5238982825844349708590772164452402960", "114697260492170345853861706687571627617", "332323691028175870407049690031183708635", "49371449643575209886305814271773923719", "148265281936500771532629880422081536066", "88362621954607999267046918250584835475", "332323691028175870407049690031183708635", "226561118763661949169023474440618283662" ], "threshold": 0.9 }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@039fec48e062504f14845124a1a25eb199b2ddc0", "signature_version": "v1" }, { "deprecated": false, "target": { "file": "crypto/pcrypt.c", "function": "pcrypt_aead_decrypt" }, "signature_type": "Function", "id": "CVE-2023-52813-b3c14f61", "digest": { "length": 754.0, "function_hash": "52104823665082570824822487464034612011" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e97bf4ada7dddacd184c3e196bd063b0dc71b41d", "signature_version": "v1" }, { "deprecated": false, "target": { "file": "crypto/pcrypt.c", "function": "pcrypt_aead_decrypt" }, "signature_type": "Function", "id": "CVE-2023-52813-bc1d8218", "digest": { "length": 713.0, "function_hash": "238374903708994763589376962752905130877" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@039fec48e062504f14845124a1a25eb199b2ddc0", "signature_version": "v1" }, { "deprecated": false, "target": { "file": "crypto/pcrypt.c" }, "signature_type": "Line", "id": "CVE-2023-52813-bd47b16a", "digest": { "line_hashes": [ "271355314635903892381271702576311611703", "193777928545415260162722962156958571488", "332323691028175870407049690031183708635", "49371449643575209886305814271773923719", "245192494053975208174008397236657446734", "249695340567295656376396635330865734293", "332323691028175870407049690031183708635", "226561118763661949169023474440618283662" ], "threshold": 0.9 }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c55fc098fd9d2dca475b82d00ffbcaf97879d77e", "signature_version": "v1" }, { "deprecated": false, "target": { "file": "crypto/pcrypt.c", "function": "pcrypt_aead_decrypt" }, "signature_type": "Function", "id": "CVE-2023-52813-c5cf94a6", "digest": { "length": 713.0, "function_hash": "238374903708994763589376962752905130877" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@fb2d3a50a8f29a3c66682bb426144f40e32ab818", "signature_version": "v1" }, { "deprecated": false, "target": { "file": "crypto/pcrypt.c" }, "signature_type": "Line", "id": "CVE-2023-52813-ea100813", "digest": { "line_hashes": [ "271355314635903892381271702576311611703", "193777928545415260162722962156958571488", "332323691028175870407049690031183708635", "49371449643575209886305814271773923719", "245192494053975208174008397236657446734", "249695340567295656376396635330865734293", "332323691028175870407049690031183708635", "226561118763661949169023474440618283662" ], "threshold": 0.9 }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8f4f68e788c3a7a696546291258bfa5fdb215523", "signature_version": "v1" }, { "deprecated": false, "target": { "file": "crypto/pcrypt.c", "function": "pcrypt_aead_encrypt" }, "signature_type": "Function", "id": "CVE-2023-52813-f10ba835", "digest": { "length": 754.0, "function_hash": "89863619838906357733328632511737576936" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c9c1334697301c10e6918d747ed38abfbc0c96e7", "signature_version": "v1" }, { "deprecated": false, "target": { "file": "crypto/pcrypt.c", "function": "pcrypt_aead_decrypt" }, "signature_type": "Function", "id": "CVE-2023-52813-fff24dc8", "digest": { "length": 754.0, "function_hash": "52104823665082570824822487464034612011" }, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c55fc098fd9d2dca475b82d00ffbcaf97879d77e", "signature_version": "v1" } ]