"value":"In the Linux kernel, the following vulnerability has been resolved:\n\nrds: tcp: Fix use-after-free of net in reqsk_timer_handler().\n\nsyzkaller reported a warning of netns tracker [0] followed by KASAN\nsplat [1] and another ref tracker warning [1].\n\nsyzkaller could not find a repro, but in the log, the only suspicious\nsequence was as follows:\n\n 18:26:22 executing program 1:\n r0 = socket$inet6_mptcp(0xa, 0x1, 0x106)\n ...\n connect$inet6(r0, &(0x7f0000000080)={0xa, 0x4001, 0x0, @loopback}, 0x1c) (async)\n\nThe notable thing here is 0x4001 in connect(), which is RDS_TCP_PORT.\n\nSo, the scenario would be:\n\n 1. unshare(CLONE_NEWNET) creates a per netns tcp listener in\n rds_tcp_listen_init().\n 2. syz-executor connect()s to it and creates a reqsk.\n 3. syz-executor exit()s immediately.\n 4. netns is dismantled. [0]\n 5. reqsk timer is fired, and UAF happens while freeing reqsk. [1]\n 6. listener is freed after RCU grace period. [2]\n\nBasically, reqsk assumes that the listener guarantees netns safety\nuntil all reqsk timers are expired by holding the listener's refcount.\nHowever, this was not the case for kernel sockets.\n\nCommit 740ea3c4a0b2 (\"tcp: Clean up kernel listener's reqsk in\ninet_twsk_purge()\")fixedthisissueonlyforper-netnsehash.\n\nLet'sapplythesamefixfortheglobalehash.\n\n[0]:\nref_tracker:netnotrefcnt@0000000065449cc3has1/1usersat\nsk_alloc(./include/net/net_namespace.h:337net/core/sock.c:2146)\ninet6_create(net/ipv6/af_inet6.c:192net/ipv6/af_inet6.c:119)\n__sock_create(net/socket.c:1572)\nrds_tcp_listen_init(net/rds/tcp_listen.c:279)\nrds_tcp_init_net(net/rds/tcp.c:577)\nops_init(net/core/net_namespace.c:137)\nsetup_net(net/core/net_namespace.c:340)\ncopy_net_ns(net/core/net_namespace.c:497)\ncreate_new_namespaces(kernel/nsproxy.c:110)\nunshare_nsproxy_namespaces(kernel/nsproxy.c:228(discriminator4))\nksys_unshare(kernel/fork.c:3429)\n__x64_sys_unshare(kernel/fork.c:3496)\ndo_syscall_64(arch/x86/entry/common.c:52arch/x86/entry/common.c:83)\nentry_SYSCALL_64_after_hwframe(arch/x86/entry/entry_64.S:129)\n...\nWARNING:CPU:0PID:27atlib/ref_tracker.c:179ref_tracker_dir_exit(lib/ref_tracker.c:179)\n\n[1]:\nBUG:KASAN:slab-use-after-freeininet_csk_reqsk_queue_drop(./include/net/inet_hashtables.h:180net/ipv4/inet_connection_sock.c:952net/ipv4/inet_connection_sock.c:966)\nReadofsize8ataddrffff88801b370400bytaskswapper/0/0\nHardwarename:QEMUStandardPC(i440FX+PIIX,1996),BIOSrel-1.16.0-0-gd239552ce722-prebuilt.qemu.org04/01/2014\nCallTrace:\n<IRQ>\ndump_stack_lvl(lib/dump_stack.c:107(discriminator1))\nprint_report(mm/kasan/report.c:378mm/kasan/report.c:488)\nkasan_report(mm/kasan/report.c:603)\ninet_csk_reqsk_queue_drop(./include/net/inet_hashtables.h:180net/ipv4/inet_connection_sock.c:952net/ipv4/inet_connection_sock.c:966)\nreqsk_timer_handler(net/ipv4/inet_connection_sock.c:979net/ipv4/inet_connection_sock.c:1092)\ncall_timer_fn(./arch/x86/include/asm/jump_label.h:27./include/linux/jump_label.h:207./include/trace/events/timer.h:127kernel/time/timer.c:1701)\n__run_timers.part.0(kernel/time/timer.c:1752kernel/time/timer.c:2038)\nrun_timer_softirq(kernel/time/timer.c:2053)\n__do_softirq(./arch/x86/include/asm/jump_label.h:27./include/linux/jump_label.h:207./include/trace/events/irq.h:142kernel/softirq.c:554)\nirq_exit_rcu(kernel/softirq.c:427kernel/softirq.c:632kernel/softirq.c:644)\nsysvec_apic_timer_interrupt(arch/x86/kernel/apic/apic.c:1076(discriminator14))\n</IRQ>\n\nAllocatedbytask258oncpu0at83.612050s:\nkasan_save_stack(mm/kasan/common.c:48)\nkasan_save_track(mm/kasan/common.c:68)\n__kasan_slab_alloc(mm/kasan/common.c:343)\nkmem_cache_alloc(mm/slub.c:3813mm/slub.c:3860mm/slub.c:3867)\ncopy_net_ns(./include/linux/slab.h:701net/core/net_namespace.c:421net/core/net_namespace.c:480)\ncreate_new_namespaces(kernel/nsproxy.c:110)\nunshare_nsproxy_name\n--