{
  "threat_severity" : "Moderate",
  "public_date" : "2024-03-04T00:00:00Z",
  "bugzilla" : {
    "description" : "kernel: inet: fully convert sk->sk_rx_dst to RCU rules",
    "id" : "2267914",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=2267914"
  },
  "cvss3" : {
    "cvss3_base_score" : "7.1",
    "cvss3_scoring_vector" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H",
    "status" : "verified"
  },
  "cwe" : "CWE-416",
  "details" : [ "In the Linux kernel, the following vulnerability has been resolved:\ninet: fully convert sk->sk_rx_dst to RCU rules\nsyzbot reported various issues around early demux,\none being included in this changelog [1]\nsk->sk_rx_dst is using RCU protection without clearly\ndocumenting it.\nAnd following sequences in tcp_v4_do_rcv()/tcp_v6_do_rcv()\nare not following standard RCU rules.\n[a]    dst_release(dst);\n[b]    sk->sk_rx_dst = NULL;\nThey look wrong because a delete operation of RCU protected\npointer is supposed to clear the pointer before\nthe call_rcu()/synchronize_rcu() guarding actual memory freeing.\nIn some cases indeed, dst could be freed before [b] is done.\nWe could cheat by clearing sk_rx_dst before calling\ndst_release(), but this seems the right time to stick\nto standard RCU annotations and debugging facilities.\n[1]\nBUG: KASAN: use-after-free in dst_check include/net/dst.h:470 [inline]\nBUG: KASAN: use-after-free in tcp_v4_early_demux+0x95b/0x960 net/ipv4/tcp_ipv4.c:1792\nRead of size 2 at addr ffff88807f1cb73a by task syz-executor.5/9204\nCPU: 0 PID: 9204 Comm: syz-executor.5 Not tainted 5.16.0-rc5-syzkaller #0\nHardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011\nCall Trace:\n<TASK>\n__dump_stack lib/dump_stack.c:88 [inline]\ndump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106\nprint_address_description.constprop.0.cold+0x8d/0x320 mm/kasan/report.c:247\n__kasan_report mm/kasan/report.c:433 [inline]\nkasan_report.cold+0x83/0xdf mm/kasan/report.c:450\ndst_check include/net/dst.h:470 [inline]\ntcp_v4_early_demux+0x95b/0x960 net/ipv4/tcp_ipv4.c:1792\nip_rcv_finish_core.constprop.0+0x15de/0x1e80 net/ipv4/ip_input.c:340\nip_list_rcv_finish.constprop.0+0x1b2/0x6e0 net/ipv4/ip_input.c:583\nip_sublist_rcv net/ipv4/ip_input.c:609 [inline]\nip_list_rcv+0x34e/0x490 net/ipv4/ip_input.c:644\n__netif_receive_skb_list_ptype net/core/dev.c:5508 [inline]\n__netif_receive_skb_list_core+0x549/0x8e0 net/core/dev.c:5556\n__netif_receive_skb_list net/core/dev.c:5608 [inline]\nnetif_receive_skb_list_internal+0x75e/0xd80 net/core/dev.c:5699\ngro_normal_list net/core/dev.c:5853 [inline]\ngro_normal_list net/core/dev.c:5849 [inline]\nnapi_complete_done+0x1f1/0x880 net/core/dev.c:6590\nvirtqueue_napi_complete drivers/net/virtio_net.c:339 [inline]\nvirtnet_poll+0xca2/0x11b0 drivers/net/virtio_net.c:1557\n__napi_poll+0xaf/0x440 net/core/dev.c:7023\nnapi_poll net/core/dev.c:7090 [inline]\nnet_rx_action+0x801/0xb40 net/core/dev.c:7177\n__do_softirq+0x29b/0x9c2 kernel/softirq.c:558\ninvoke_softirq kernel/softirq.c:432 [inline]\n__irq_exit_rcu+0x123/0x180 kernel/softirq.c:637\nirq_exit_rcu+0x5/0x20 kernel/softirq.c:649\ncommon_interrupt+0x52/0xc0 arch/x86/kernel/irq.c:240\nasm_common_interrupt+0x1e/0x40 arch/x86/include/asm/idtentry.h:629\nRIP: 0033:0x7f5e972bfd57\nCode: 39 d1 73 14 0f 1f 80 00 00 00 00 48 8b 50 f8 48 83 e8 08 48 39 ca 77 f3 48 39 c3 73 3e 48 89 13 48 8b 50 f8 48 89 38 49 8b 0e <48> 8b 3e 48 83 c3 08 48 83 c6 08 eb bc 48 39 d1 72 9e 48 39 d0 73\nRSP: 002b:00007fff8a413210 EFLAGS: 00000283\nRAX: 00007f5e97108990 RBX: 00007f5e97108338 RCX: ffffffff81d3aa45\nRDX: ffffffff81d3aa45 RSI: 00007f5e97108340 RDI: ffffffff81d3aa45\nRBP: 00007f5e97107eb8 R08: 00007f5e97108d88 R09: 0000000093c2e8d9\nR10: 0000000000000000 R11: 0000000000000000 R12: 00007f5e97107eb0\nR13: 00007f5e97108338 R14: 00007f5e97107ea8 R15: 0000000000000019\n</TASK>\nAllocated by task 13:\nkasan_save_stack+0x1e/0x50 mm/kasan/common.c:38\nkasan_set_track mm/kasan/common.c:46 [inline]\nset_alloc_info mm/kasan/common.c:434 [inline]\n__kasan_slab_alloc+0x90/0xc0 mm/kasan/common.c:467\nkasan_slab_alloc include/linux/kasan.h:259 [inline]\nslab_post_alloc_hook mm/slab.h:519 [inline]\nslab_alloc_node mm/slub.c:3234 [inline]\nslab_alloc mm/slub.c:3242 [inline]\nkmem_cache_alloc+0x202/0x3a0 mm/slub.c:3247\ndst_alloc+0x146/0x1f0 net/core/dst.c:92\nrt_dst_alloc+0x73/0x430 net/ipv4/route.c:1613\nip_route_input_slow+0x1817/0x3a20 net/ipv4/route.c:234\n---truncated---", "A use-after-free vulnerability was found in the TCP IP protocol in the Linux Kernel, where a delete operation of the RCU-protected pointer is supposed to clear the pointer before the call_rcu()/synchronize_rcu() guarding the actual memory freeing. This flaw allows a local attacker to crash the system or leak kernel internal information." ],
  "affected_release" : [ {
    "product_name" : "Red Hat Enterprise Linux 8",
    "release_date" : "2022-11-08T00:00:00Z",
    "advisory" : "RHSA-2022:7683",
    "cpe" : "cpe:/o:redhat:enterprise_linux:8",
    "package" : "kernel-0:4.18.0-425.3.1.el8"
  }, {
    "product_name" : "Red Hat Enterprise Linux 9",
    "release_date" : "2022-11-15T00:00:00Z",
    "advisory" : "RHSA-2022:8267",
    "cpe" : "cpe:/a:redhat:enterprise_linux:9",
    "package" : "kernel-0:5.14.0-162.6.1.el9_1"
  }, {
    "product_name" : "Red Hat Enterprise Linux 9",
    "release_date" : "2022-11-15T00:00:00Z",
    "advisory" : "RHSA-2022:8267",
    "cpe" : "cpe:/o:redhat:enterprise_linux:9",
    "package" : "kernel-0:5.14.0-162.6.1.el9_1"
  } ],
  "package_state" : [ {
    "product_name" : "Red Hat Enterprise Linux 6",
    "fix_state" : "Out of support scope",
    "package_name" : "kernel",
    "cpe" : "cpe:/o:redhat:enterprise_linux:6"
  }, {
    "product_name" : "Red Hat Enterprise Linux 7",
    "fix_state" : "Out of support scope",
    "package_name" : "kernel",
    "cpe" : "cpe:/o:redhat:enterprise_linux:7"
  }, {
    "product_name" : "Red Hat Enterprise Linux 7",
    "fix_state" : "Out of support scope",
    "package_name" : "kernel-rt",
    "cpe" : "cpe:/o:redhat:enterprise_linux:7"
  }, {
    "product_name" : "Red Hat Enterprise Linux 8",
    "fix_state" : "Affected",
    "package_name" : "kernel-rt",
    "cpe" : "cpe:/o:redhat:enterprise_linux:8"
  }, {
    "product_name" : "Red Hat Enterprise Linux 9",
    "fix_state" : "Affected",
    "package_name" : "kernel-rt",
    "cpe" : "cpe:/o:redhat:enterprise_linux:9"
  } ],
  "references" : [ "https://www.cve.org/CVERecord?id=CVE-2021-47103\nhttps://nvd.nist.gov/vuln/detail/CVE-2021-47103\nhttps://lore.kernel.org/linux-cve-announce/2024030416-CVE-2021-47103-4314@gregkh/T" ],
  "name" : "CVE-2021-47103",
  "csaw" : false
}