[BUG] use-after-free in ar5523_rx_refill_work()

co <[email protected]>
Newsgroups org.kernel.vger.linux-wireless,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
We found a bug reachable in:

    path    lib
    crash   use-after-free in ar5523_rx_refill_work()
    commit  3cd8b194bf34 ("Merge tag 'v7.1-rc-part1-smbdirect-fixes' of git://git.samba.org/ksmbd")

Config, environment, the sanitizer report and a C reproducer follow.

== Notes ===============================================================
    If you patch the bug based on our artifacts, a tag would be
    appreciated:

Reported-by: [email protected]

    Everything in this mail is validated by the reproducer below.

    We also hold an LLM-generated root-cause analysis and a candidate
    patch. The patch passes an A/B test: the same reproducer panics the
    unpatched kernel and runs clean on the patched one. Neither has had
    human review, so both still require validation before you send or
    apply them. Available on:

        patch.diff  https://bugs.sh/b/cd639b9313e09550/patch.diff
        report.md   https://bugs.sh/b/cd639b9313e09550/report.md

    This is an open science project. The code and the full set of PoCs
    are not public at this moment, as we intend to disclose our findings
    in an ethical way.

    Happy to test patches. Complaints and suggestions about our work
    are welcome at:

        [email protected]

== Environment =========================================================
    Reproduced on  3cd8b194bf34 ("Merge tag 'v7.1-rc-part1-smbdirect-fixes' of git://git.samba.org/ksmbd")
    VM setup       https://bugs.sh/b/cd639b9313e09550/run.sh
    config         https://bugs.sh/b/cd639b9313e09550/config.gz
    poc            https://bugs.sh/b/cd639b9313e09550/repro.c

== Sanitizer Report ====================================================
BUG: KASAN: slab-use-after-free in ar5523_rx_refill_work (./include/linux/usb.h:1739 drivers/net/wireless/ath/ar5523/ar5523.c:743)
Write of size 8 at addr ffff8880173a3940 by task kworker/u8:0/12
Workqueue: ar5523 ar5523_rx_refill_work
Call Trace:
dump_stack_lvl (lib/dump_stack.c:123)
print_report (mm/kasan/report.c:379 mm/kasan/report.c:482)
kasan_report (mm/kasan/report.c:597)
ar5523_rx_refill_work (./include/linux/usb.h:1739 drivers/net/wireless/ath/ar5523/ar5523.c:743)
process_one_work (kernel/workqueue.c:3307)
worker_thread (kernel/workqueue.c:3379 (discriminator 2) kernel/workqueue.c:3466 (discriminator 2))
kthread (kernel/kthread.c:436)
ret_from_fork (arch/x86/kernel/process.c:164)
ret_from_fork_asm (arch/x86/entry/entry_64.S:255)
which belongs to the cache kmalloc-192 of size 192
freed 192-byte region [ffff8880173a3900, ffff8880173a39c0)
list_del corruption, ffff88801bf220d0->next is LIST_POISON1 (dead000000000100)
kernel BUG at lib/list_debug.c:56!
Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI
Workqueue: ar5523 ar5523_rx_refill_work
RIP: 0010:__list_del_entry_valid_or_report (lib/list_debug.c:56 (discriminator 1))
Call Trace:
ar5523_rx_refill_work (./include/linux/list.h:223 (discriminator 1) ./include/linux/list.h:306 (discriminator 1) drivers/net/wireless/ath/ar5523/ar5523.c:748 (discriminator 1))
process_one_work (kernel/workqueue.c:3307)
worker_thread (kernel/workqueue.c:3379 (discriminator 2) kernel/workqueue.c:3466 (discriminator 2))
kthread (kernel/kthread.c:436)
ret_from_fork (arch/x86/kernel/process.c:164)
ret_from_fork_asm (arch/x86/entry/entry_64.S:255)


---
The report format is based on syzbot bug report.

This report is generated by a bot. It may contain errors.
See https://github.com/n132/cedalion for more information.

For any issue with this report, reach out to [email protected]

If the report is already addressed, let us know by replying with:
#co fix: <commit hash>

If the report is a duplicate of another one, reply with:
#co dup: <lore link>

If you want to undo deduplication, reply with:
#co undup
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.