[BUG] drivers/net: out-of-bounds in ar5523_cmd_rx_cb()

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    drivers/net/wireless/ath/ar5523
    crash   out-of-bounds in ar5523_cmd_rx_cb()
    commit  4e15e89faac9 ("net: bnxt: ring the doorbell when SW USO exits early")

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/a27ae3497f0074da/patch.diff
        report.md   https://bugs.sh/b/a27ae3497f0074da/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  4e15e89faac9 ("net: bnxt: ring the doorbell when SW USO exits early")
    VM setup       https://bugs.sh/b/a27ae3497f0074da/run.sh
    config         https://bugs.sh/b/a27ae3497f0074da/config.gz
    poc            https://bugs.sh/b/a27ae3497f0074da/repro.c

== Sanitizer Report ====================================================
BUG: KASAN: out-of-bounds in ar5523_cmd_rx_cb (drivers/net/wireless/ath/ar5523/ar5523.c:83 (discriminator 6) drivers/net/wireless/ath/ar5523/ar5523.c:125 (discriminator 6))
Read of size 18446744071562067968 at addr ffff88800df00024 by task swapper/1/0
CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Not tainted 7.2.0+ #56 PREEMPTLAZY
Call Trace:
<IRQ>
dump_stack_lvl (lib/dump_stack.c:94 lib/dump_stack.c:120)
print_report (mm/kasan/report.c:378 mm/kasan/report.c:482)
kasan_report (mm/kasan/report.c:595)
kasan_check_range (mm/kasan/generic.c:186 mm/kasan/generic.c:200)
__asan_memcpy (mm/kasan/shadow.c:105 (discriminator 1))
ar5523_cmd_rx_cb (drivers/net/wireless/ath/ar5523/ar5523.c:83 (discriminator 6) drivers/net/wireless/ath/ar5523/ar5523.c:125 (discriminator 6))
__usb_hcd_giveback_urb (drivers/usb/core/hcd.c:1657)
dummy_timer (drivers/usb/gadget/udc/dummy_hcd.c:2019 (discriminator 1))
__hrtimer_run_queues (kernel/time/hrtimer.c:2067 kernel/time/hrtimer.c:2124)
hrtimer_run_softirq (kernel/time/hrtimer.c:2141)
handle_softirqs (kernel/softirq.c:645)
__irq_exit_rcu (kernel/softirq.c:679 kernel/softirq.c:519 kernel/softirq.c:767)
sysvec_apic_timer_interrupt (arch/x86/kernel/apic/apic.c:1062 (discriminator 35) arch/x86/kernel/apic/apic.c:1062 (discriminator 35))
</IRQ>
asm_sysvec_apic_timer_interrupt (./arch/x86/include/asm/idtentry.h:674)
default_idle (./arch/x86/include/asm/paravirt.h:62 arch/x86/kernel/process.c:768)
default_idle_call (kernel/sched/idle.c:122)
do_idle (kernel/sched/idle.c:199 kernel/sched/idle.c:355)
cpu_startup_entry (kernel/sched/idle.c:454 (discriminator 1))
start_secondary (arch/x86/kernel/smpboot.c:312)
common_startup_64 (arch/x86/kernel/head_64.S:418)
Allocated by task 45:
The buggy address belongs to the object at ffff88800df00000
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 36 bytes inside of
1024-byte region [ffff88800df00000, ffff88800df00400)
The buggy address belongs to the physical page:
Memory state around the buggy address:
ffff88800defff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88800defff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88800df00000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
^
ffff88800df00080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88800df00100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Kernel panic - not syncing: Fatal exception in interrupt


---
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.