[BUG] drivers/vdpa: use-after-free in sk_skb_reason_drop()

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

    path    drivers/vdpa
    crash   use-after-free in sk_skb_reason_drop()
    commit  bd5f485f3f02 ("Merge tag 'soc-arm-7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc")

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/6dcbccedc9ec6452/patch.diff
        report.md   https://bugs.sh/b/6dcbccedc9ec6452/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  bd5f485f3f02 ("Merge tag 'soc-arm-7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc")
    VM setup       https://bugs.sh/b/6dcbccedc9ec6452/run.sh
    config         https://bugs.sh/b/6dcbccedc9ec6452/config.gz
    poc            https://bugs.sh/b/6dcbccedc9ec6452/repro.c

== Sanitizer Report ====================================================
BUG: KASAN: slab-use-after-free in sk_skb_reason_drop (./include/linux/instrumented.h:82 ./include/linux/atomic/atomic-instrumented.h:32 ./include/linux/refcount.h:170 ./include/linux/skbuff.h:1290 net/core/skbuff.c:1220 net/core/skbuff.c:1249)
Read of size 4 at addr ffff888013ca3adc by task exploit/145
CPU: 1 UID: 65534 PID: 145 Comm: exploit Not tainted 7.2.0+ #8 PREEMPTLAZY
Call Trace:
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)
sk_skb_reason_drop (./include/linux/instrumented.h:82 ./include/linux/atomic/atomic-instrumented.h:32 ./include/linux/refcount.h:170 ./include/linux/skbuff.h:1290 net/core/skbuff.c:1220 net/core/skbuff.c:1249)
vdpa_nl_cmd_dev_config_get_doit (./include/linux/skbuff.h:1323 ./include/linux/skbuff.h:1332 ./include/net/netlink.h:1131 drivers/vdpa/vdpa.c:1324)
genl_family_rcv_msg_doit (net/netlink/genetlink.c:1114)
genl_rcv_msg (net/netlink/genetlink.c:1194 net/netlink/genetlink.c:1209)
netlink_rcv_skb (net/netlink/af_netlink.c:2556)
genl_rcv (net/netlink/genetlink.c:1218)
netlink_unicast (net/netlink/af_netlink.c:1319 net/netlink/af_netlink.c:1345)
netlink_sendmsg (net/netlink/af_netlink.c:1900)
__sys_sendto (net/socket.c:800 (discriminator 1) net/socket.c:815 (discriminator 1) net/socket.c:2277 (discriminator 1))
__x64_sys_sendto (net/socket.c:2284 net/socket.c:2280 net/socket.c:2280)
do_syscall_64 (arch/x86/entry/syscall_64.c:61 arch/x86/entry/syscall_64.c:84)
entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121)
The buggy address belongs to the object at ffff888013ca3a00
which belongs to the cache skbuff_head_cache of size 232
The buggy address is located 220 bytes inside of


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