{"api_version":"1","generated_at":"2026-08-06T14:12:50+00:00","cve":"CVE-2026-64599","urls":{"html":"https://cve.report/CVE-2026-64599","api":"https://cve.report/api/cve/CVE-2026-64599.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-64599","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-64599"},"summary":{"title":"crypto: amlogic - avoid double cleanup in meson_crypto_probe()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\ncrypto: amlogic - avoid double cleanup in meson_crypto_probe()\n\nWhen meson_allocate_chanlist() fails after a partial allocation, it already\nunwinds the allocated chanlist state through its local error path.\nmeson_crypto_probe() then jump to error_flow and calls\nmeson_free_chanlist() again, causing the same per-flow resources to be torn\ndown twice. In the reproduced failure path, the second teardown\nre-entered crypto_engine_exit() on an already destroyed worker and KASAN\nreported a slab-use-after-free in kthread_destroy_worker().\n\nPrevent double-free by handling partial allocation failures locally within\nmeson_allocate_chanlist() and skipping the outer cleanup path.\n\nThe bug was first flagged by an experimental analysis tool we are\ndeveloping for kernel memory-management bugs while analyzing\nv6.13-rc1. The tool is still under development and is not yet publicly\navailable.\n\nThe bug was reproduced in a QEMU x86_64 guest booted with KASAN on v7.1,\nusing the reproducer under tools/testing/meson_crypto_probe. The reproducer\nforces the second dma_alloc_attrs() call in the gxl-crypto probe path to\nreturn NULL, making meson_allocate_chanlist() fail after partial\ninitialization. On the unpatched kernel this reliably triggered a\nslab-use-after-free. With this fix applied, the same reproducer no longer\nemits any KASAN report and the probe fails cleanly with -ENOMEM.\n\n    ==================================================================\n    BUG: KASAN: slab-use-after-free in kthread_destroy_worker+0xb2/0xd0\n    Read of size 8 at addr ff1100010c057a68 by task insmod/265\n\n    CPU: 1 UID: 0 PID: 265 Comm: insmod Tainted: G           O        7.1.0-rc2-00376-g810af9adc907-dirty #10 PREEMPT(lazy)\n    Tainted: [O]=OOT_MODULE\n    Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.15.0-1 04/01/2014\n    Call Trace:\n     <TASK>\n     dump_stack_lvl+0x68/0xa0\n     print_report+0xcb/0x5e0\n     ? __virt_addr_valid+0x21d/0x3f0\n     ? kthread_destroy_worker+0xb2/0xd0\n     ? kthread_destroy_worker+0xb2/0xd0\n     kasan_report+0xca/0x100\n     ? kthread_destroy_worker+0xb2/0xd0\n     kthread_destroy_worker+0xb2/0xd0\n     meson_crypto_probe+0x4d0/0xc10 [amlogic_gxl_crypto]\n     platform_probe+0x99/0x140\n     really_probe+0x1c6/0x6a0\n     ? __pfx___device_attach_driver+0x10/0x10\n     __driver_probe_device+0x248/0x310\n     ? acpi_driver_match_device+0xb0/0x100\n     driver_probe_device+0x48/0x210\n     ? __pfx___device_attach_driver+0x10/0x10\n     __device_attach_driver+0x160/0x320\n     bus_for_each_drv+0x104/0x190\n     ? __pfx_bus_for_each_drv+0x10/0x10\n     ? _raw_spin_unlock_irqrestore+0x2c/0x50\n     __device_attach+0x19d/0x3b0\n     ? __pfx___device_attach+0x10/0x10\n     ? do_raw_spin_unlock+0x53/0x220\n     device_initial_probe+0x78/0xa0\n     bus_probe_device+0x5b/0x130\n     device_add+0xcfd/0x1430\n     ? __pfx_device_add+0x10/0x10\n     ? insert_resource+0x34/0x50\n     ? lock_release+0xc9/0x290\n     platform_device_add+0x24e/0x590\n     ? __pfx_meson_crypto_probe_repro_init+0x10/0x10 [meson_crypto_probe_repro]\n     meson_crypto_probe_repro_init+0x330/0xff0 [meson_crypto_probe_repro]\n     do_one_initcall+0xc0/0x450\n     ? __pfx_do_one_initcall+0x10/0x10\n     ? _raw_spin_unlock_irqrestore+0x2c/0x50\n     ? __create_object+0x59/0x80\n     ? kasan_unpoison+0x27/0x60\n     do_init_module+0x27b/0x7d0\n     ? __pfx_do_init_module+0x10/0x10\n     ? kasan_quarantine_put+0x84/0x1d0\n     ? kfree+0x32c/0x510\n     ? load_module+0x561e/0x5ff0\n     load_module+0x54fe/0x5ff0\n     ? __pfx_load_module+0x10/0x10\n     ? security_file_permission+0x20/0x40\n     ? kernel_read_file+0x23d/0x6e0\n     ? mmap_region+0x235/0x4a0\n     ? __pfx_kernel_read_file+0x10/0x10\n     ? __file_has_perm+0x2c0/0x3e0\n     init_module_from_file+0x158/0x180\n     ? __pfx_init_module_from_file+0x10/0x10\n     ? __lock_acquire+0x45a/0x1ba0\n     ? idempotent_init_module+0x315/0x610\n     ? lock_release+0xc9/0x290\n     ? lock\n---truncated---","state":"PUBLISHED","assigner":"Linux","published_at":"2026-08-06 08:16:35","updated_at":"2026-08-06 08:16:35"},"problem_types":[],"metrics":[],"references":[{"url":"https://git.kernel.org/stable/c/c80360b4e85099fc3835378a96a59c0a2480fb07","name":"https://git.kernel.org/stable/c/c80360b4e85099fc3835378a96a59c0a2480fb07","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/5b452019a4127f63c1f2147237fc287d1581f606","name":"https://git.kernel.org/stable/c/5b452019a4127f63c1f2147237fc287d1581f606","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/6effdbaca3cd8354540bdf42c7f5fb84412afeb7","name":"https://git.kernel.org/stable/c/6effdbaca3cd8354540bdf42c7f5fb84412afeb7","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/6d827ade51a24e18d81afb9f32756d339520a14c","name":"https://git.kernel.org/stable/c/6d827ade51a24e18d81afb9f32756d339520a14c","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/6dda8406d8a3da2519c8b388d443d7357839cb63","name":"https://git.kernel.org/stable/c/6dda8406d8a3da2519c8b388d443d7357839cb63","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/f30e2b879bda14bc3e1524fba6f8ab9ec119da90","name":"https://git.kernel.org/stable/c/f30e2b879bda14bc3e1524fba6f8ab9ec119da90","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/84a00be9b736aa5dce902a290f62cbbbdcfab9ed","name":"https://git.kernel.org/stable/c/84a00be9b736aa5dce902a290f62cbbbdcfab9ed","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/c2c48aa7a6be36d4c93da75d14d4b4f2f4168c81","name":"https://git.kernel.org/stable/c/c2c48aa7a6be36d4c93da75d14d4b4f2f4168c81","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-64599","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-64599","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 48fe583fe54177bfb80f348e2a5cc34c3f710095 c2c48aa7a6be36d4c93da75d14d4b4f2f4168c81 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 48fe583fe54177bfb80f348e2a5cc34c3f710095 c80360b4e85099fc3835378a96a59c0a2480fb07 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 48fe583fe54177bfb80f348e2a5cc34c3f710095 5b452019a4127f63c1f2147237fc287d1581f606 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 48fe583fe54177bfb80f348e2a5cc34c3f710095 f30e2b879bda14bc3e1524fba6f8ab9ec119da90 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 48fe583fe54177bfb80f348e2a5cc34c3f710095 6effdbaca3cd8354540bdf42c7f5fb84412afeb7 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 48fe583fe54177bfb80f348e2a5cc34c3f710095 84a00be9b736aa5dce902a290f62cbbbdcfab9ed git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 48fe583fe54177bfb80f348e2a5cc34c3f710095 6dda8406d8a3da2519c8b388d443d7357839cb63 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 48fe583fe54177bfb80f348e2a5cc34c3f710095 6d827ade51a24e18d81afb9f32756d339520a14c git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 5.5","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 5.5 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 5.10.261 5.10.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 5.15.212 5.15.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.1.178 6.1.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.6.145 6.6.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.12.96 6.12.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.18.39 6.18.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.1.4 7.1.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.2-rc1 * original_commit_for_fix","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["drivers/crypto/amlogic/amlogic-gxl-core.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"c2c48aa7a6be36d4c93da75d14d4b4f2f4168c81","status":"affected","version":"48fe583fe54177bfb80f348e2a5cc34c3f710095","versionType":"git"},{"lessThan":"c80360b4e85099fc3835378a96a59c0a2480fb07","status":"affected","version":"48fe583fe54177bfb80f348e2a5cc34c3f710095","versionType":"git"},{"lessThan":"5b452019a4127f63c1f2147237fc287d1581f606","status":"affected","version":"48fe583fe54177bfb80f348e2a5cc34c3f710095","versionType":"git"},{"lessThan":"f30e2b879bda14bc3e1524fba6f8ab9ec119da90","status":"affected","version":"48fe583fe54177bfb80f348e2a5cc34c3f710095","versionType":"git"},{"lessThan":"6effdbaca3cd8354540bdf42c7f5fb84412afeb7","status":"affected","version":"48fe583fe54177bfb80f348e2a5cc34c3f710095","versionType":"git"},{"lessThan":"84a00be9b736aa5dce902a290f62cbbbdcfab9ed","status":"affected","version":"48fe583fe54177bfb80f348e2a5cc34c3f710095","versionType":"git"},{"lessThan":"6dda8406d8a3da2519c8b388d443d7357839cb63","status":"affected","version":"48fe583fe54177bfb80f348e2a5cc34c3f710095","versionType":"git"},{"lessThan":"6d827ade51a24e18d81afb9f32756d339520a14c","status":"affected","version":"48fe583fe54177bfb80f348e2a5cc34c3f710095","versionType":"git"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["drivers/crypto/amlogic/amlogic-gxl-core.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"5.5"},{"lessThan":"5.5","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"5.10.*","status":"unaffected","version":"5.10.261","versionType":"semver"},{"lessThanOrEqual":"5.15.*","status":"unaffected","version":"5.15.212","versionType":"semver"},{"lessThanOrEqual":"6.1.*","status":"unaffected","version":"6.1.178","versionType":"semver"},{"lessThanOrEqual":"6.6.*","status":"unaffected","version":"6.6.145","versionType":"semver"},{"lessThanOrEqual":"6.12.*","status":"unaffected","version":"6.12.96","versionType":"semver"},{"lessThanOrEqual":"6.18.*","status":"unaffected","version":"6.18.39","versionType":"semver"},{"lessThanOrEqual":"7.1.*","status":"unaffected","version":"7.1.4","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.2-rc1","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"5.10.261","versionStartIncluding":"5.5","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"5.15.212","versionStartIncluding":"5.5","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.1.178","versionStartIncluding":"5.5","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.6.145","versionStartIncluding":"5.5","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.12.96","versionStartIncluding":"5.5","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.18.39","versionStartIncluding":"5.5","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.1.4","versionStartIncluding":"5.5","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.2-rc1","versionStartIncluding":"5.5","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\ncrypto: amlogic - avoid double cleanup in meson_crypto_probe()\n\nWhen meson_allocate_chanlist() fails after a partial allocation, it already\nunwinds the allocated chanlist state through its local error path.\nmeson_crypto_probe() then jump to error_flow and calls\nmeson_free_chanlist() again, causing the same per-flow resources to be torn\ndown twice. In the reproduced failure path, the second teardown\nre-entered crypto_engine_exit() on an already destroyed worker and KASAN\nreported a slab-use-after-free in kthread_destroy_worker().\n\nPrevent double-free by handling partial allocation failures locally within\nmeson_allocate_chanlist() and skipping the outer cleanup path.\n\nThe bug was first flagged by an experimental analysis tool we are\ndeveloping for kernel memory-management bugs while analyzing\nv6.13-rc1. The tool is still under development and is not yet publicly\navailable.\n\nThe bug was reproduced in a QEMU x86_64 guest booted with KASAN on v7.1,\nusing the reproducer under tools/testing/meson_crypto_probe. The reproducer\nforces the second dma_alloc_attrs() call in the gxl-crypto probe path to\nreturn NULL, making meson_allocate_chanlist() fail after partial\ninitialization. On the unpatched kernel this reliably triggered a\nslab-use-after-free. With this fix applied, the same reproducer no longer\nemits any KASAN report and the probe fails cleanly with -ENOMEM.\n\n    ==================================================================\n    BUG: KASAN: slab-use-after-free in kthread_destroy_worker+0xb2/0xd0\n    Read of size 8 at addr ff1100010c057a68 by task insmod/265\n\n    CPU: 1 UID: 0 PID: 265 Comm: insmod Tainted: G           O        7.1.0-rc2-00376-g810af9adc907-dirty #10 PREEMPT(lazy)\n    Tainted: [O]=OOT_MODULE\n    Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.15.0-1 04/01/2014\n    Call Trace:\n     <TASK>\n     dump_stack_lvl+0x68/0xa0\n     print_report+0xcb/0x5e0\n     ? __virt_addr_valid+0x21d/0x3f0\n     ? kthread_destroy_worker+0xb2/0xd0\n     ? kthread_destroy_worker+0xb2/0xd0\n     kasan_report+0xca/0x100\n     ? kthread_destroy_worker+0xb2/0xd0\n     kthread_destroy_worker+0xb2/0xd0\n     meson_crypto_probe+0x4d0/0xc10 [amlogic_gxl_crypto]\n     platform_probe+0x99/0x140\n     really_probe+0x1c6/0x6a0\n     ? __pfx___device_attach_driver+0x10/0x10\n     __driver_probe_device+0x248/0x310\n     ? acpi_driver_match_device+0xb0/0x100\n     driver_probe_device+0x48/0x210\n     ? __pfx___device_attach_driver+0x10/0x10\n     __device_attach_driver+0x160/0x320\n     bus_for_each_drv+0x104/0x190\n     ? __pfx_bus_for_each_drv+0x10/0x10\n     ? _raw_spin_unlock_irqrestore+0x2c/0x50\n     __device_attach+0x19d/0x3b0\n     ? __pfx___device_attach+0x10/0x10\n     ? do_raw_spin_unlock+0x53/0x220\n     device_initial_probe+0x78/0xa0\n     bus_probe_device+0x5b/0x130\n     device_add+0xcfd/0x1430\n     ? __pfx_device_add+0x10/0x10\n     ? insert_resource+0x34/0x50\n     ? lock_release+0xc9/0x290\n     platform_device_add+0x24e/0x590\n     ? __pfx_meson_crypto_probe_repro_init+0x10/0x10 [meson_crypto_probe_repro]\n     meson_crypto_probe_repro_init+0x330/0xff0 [meson_crypto_probe_repro]\n     do_one_initcall+0xc0/0x450\n     ? __pfx_do_one_initcall+0x10/0x10\n     ? _raw_spin_unlock_irqrestore+0x2c/0x50\n     ? __create_object+0x59/0x80\n     ? kasan_unpoison+0x27/0x60\n     do_init_module+0x27b/0x7d0\n     ? __pfx_do_init_module+0x10/0x10\n     ? kasan_quarantine_put+0x84/0x1d0\n     ? kfree+0x32c/0x510\n     ? load_module+0x561e/0x5ff0\n     load_module+0x54fe/0x5ff0\n     ? __pfx_load_module+0x10/0x10\n     ? security_file_permission+0x20/0x40\n     ? kernel_read_file+0x23d/0x6e0\n     ? mmap_region+0x235/0x4a0\n     ? __pfx_kernel_read_file+0x10/0x10\n     ? __file_has_perm+0x2c0/0x3e0\n     init_module_from_file+0x158/0x180\n     ? __pfx_init_module_from_file+0x10/0x10\n     ? __lock_acquire+0x45a/0x1ba0\n     ? idempotent_init_module+0x315/0x610\n     ? lock_release+0xc9/0x290\n     ? lock\n---truncated---"}],"providerMetadata":{"dateUpdated":"2026-08-06T07:13:53.328Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/c2c48aa7a6be36d4c93da75d14d4b4f2f4168c81"},{"url":"https://git.kernel.org/stable/c/c80360b4e85099fc3835378a96a59c0a2480fb07"},{"url":"https://git.kernel.org/stable/c/5b452019a4127f63c1f2147237fc287d1581f606"},{"url":"https://git.kernel.org/stable/c/f30e2b879bda14bc3e1524fba6f8ab9ec119da90"},{"url":"https://git.kernel.org/stable/c/6effdbaca3cd8354540bdf42c7f5fb84412afeb7"},{"url":"https://git.kernel.org/stable/c/84a00be9b736aa5dce902a290f62cbbbdcfab9ed"},{"url":"https://git.kernel.org/stable/c/6dda8406d8a3da2519c8b388d443d7357839cb63"},{"url":"https://git.kernel.org/stable/c/6d827ade51a24e18d81afb9f32756d339520a14c"}],"title":"crypto: amlogic - avoid double cleanup in meson_crypto_probe()","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-64599","datePublished":"2026-08-06T07:13:53.328Z","dateReserved":"2026-07-19T15:36:31.799Z","dateUpdated":"2026-08-06T07:13:53.328Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-08-06 08:16:35","lastModifiedDate":"2026-08-06 08:16:35","problem_types":[],"metrics":[],"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"64599","Ordinal":"1","Title":"crypto: amlogic - avoid double cleanup in meson_crypto_probe()","CVE":"CVE-2026-64599","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"64599","Ordinal":"1","NoteData":"In the Linux kernel, the following vulnerability has been resolved:\n\ncrypto: amlogic - avoid double cleanup in meson_crypto_probe()\n\nWhen meson_allocate_chanlist() fails after a partial allocation, it already\nunwinds the allocated chanlist state through its local error path.\nmeson_crypto_probe() then jump to error_flow and calls\nmeson_free_chanlist() again, causing the same per-flow resources to be torn\ndown twice. In the reproduced failure path, the second teardown\nre-entered crypto_engine_exit() on an already destroyed worker and KASAN\nreported a slab-use-after-free in kthread_destroy_worker().\n\nPrevent double-free by handling partial allocation failures locally within\nmeson_allocate_chanlist() and skipping the outer cleanup path.\n\nThe bug was first flagged by an experimental analysis tool we are\ndeveloping for kernel memory-management bugs while analyzing\nv6.13-rc1. The tool is still under development and is not yet publicly\navailable.\n\nThe bug was reproduced in a QEMU x86_64 guest booted with KASAN on v7.1,\nusing the reproducer under tools/testing/meson_crypto_probe. The reproducer\nforces the second dma_alloc_attrs() call in the gxl-crypto probe path to\nreturn NULL, making meson_allocate_chanlist() fail after partial\ninitialization. On the unpatched kernel this reliably triggered a\nslab-use-after-free. With this fix applied, the same reproducer no longer\nemits any KASAN report and the probe fails cleanly with -ENOMEM.\n\n    ==================================================================\n    BUG: KASAN: slab-use-after-free in kthread_destroy_worker+0xb2/0xd0\n    Read of size 8 at addr ff1100010c057a68 by task insmod/265\n\n    CPU: 1 UID: 0 PID: 265 Comm: insmod Tainted: G           O        7.1.0-rc2-00376-g810af9adc907-dirty #10 PREEMPT(lazy)\n    Tainted: [O]=OOT_MODULE\n    Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.15.0-1 04/01/2014\n    Call Trace:\n     <TASK>\n     dump_stack_lvl+0x68/0xa0\n     print_report+0xcb/0x5e0\n     ? __virt_addr_valid+0x21d/0x3f0\n     ? kthread_destroy_worker+0xb2/0xd0\n     ? kthread_destroy_worker+0xb2/0xd0\n     kasan_report+0xca/0x100\n     ? kthread_destroy_worker+0xb2/0xd0\n     kthread_destroy_worker+0xb2/0xd0\n     meson_crypto_probe+0x4d0/0xc10 [amlogic_gxl_crypto]\n     platform_probe+0x99/0x140\n     really_probe+0x1c6/0x6a0\n     ? __pfx___device_attach_driver+0x10/0x10\n     __driver_probe_device+0x248/0x310\n     ? acpi_driver_match_device+0xb0/0x100\n     driver_probe_device+0x48/0x210\n     ? __pfx___device_attach_driver+0x10/0x10\n     __device_attach_driver+0x160/0x320\n     bus_for_each_drv+0x104/0x190\n     ? __pfx_bus_for_each_drv+0x10/0x10\n     ? _raw_spin_unlock_irqrestore+0x2c/0x50\n     __device_attach+0x19d/0x3b0\n     ? __pfx___device_attach+0x10/0x10\n     ? do_raw_spin_unlock+0x53/0x220\n     device_initial_probe+0x78/0xa0\n     bus_probe_device+0x5b/0x130\n     device_add+0xcfd/0x1430\n     ? __pfx_device_add+0x10/0x10\n     ? insert_resource+0x34/0x50\n     ? lock_release+0xc9/0x290\n     platform_device_add+0x24e/0x590\n     ? __pfx_meson_crypto_probe_repro_init+0x10/0x10 [meson_crypto_probe_repro]\n     meson_crypto_probe_repro_init+0x330/0xff0 [meson_crypto_probe_repro]\n     do_one_initcall+0xc0/0x450\n     ? __pfx_do_one_initcall+0x10/0x10\n     ? _raw_spin_unlock_irqrestore+0x2c/0x50\n     ? __create_object+0x59/0x80\n     ? kasan_unpoison+0x27/0x60\n     do_init_module+0x27b/0x7d0\n     ? __pfx_do_init_module+0x10/0x10\n     ? kasan_quarantine_put+0x84/0x1d0\n     ? kfree+0x32c/0x510\n     ? load_module+0x561e/0x5ff0\n     load_module+0x54fe/0x5ff0\n     ? __pfx_load_module+0x10/0x10\n     ? security_file_permission+0x20/0x40\n     ? kernel_read_file+0x23d/0x6e0\n     ? mmap_region+0x235/0x4a0\n     ? __pfx_kernel_read_file+0x10/0x10\n     ? __file_has_perm+0x2c0/0x3e0\n     init_module_from_file+0x158/0x180\n     ? __pfx_init_module_from_file+0x10/0x10\n     ? __lock_acquire+0x45a/0x1ba0\n     ? idempotent_init_module+0x315/0x610\n     ? lock_release+0xc9/0x290\n     ? lock\n---truncated---","Type":"Description","Title":"crypto: amlogic - avoid double cleanup in meson_crypto_probe()"}]}}}