{
  "threat_severity" : "Low",
  "public_date" : "2024-05-30T00:00:00Z",
  "bugzilla" : {
    "description" : "kernel: nsh: Restore skb-&gt;{protocol,data,mac_header} for outer header in nsh_gso_segment().",
    "id" : "2284488",
    "url" : "https://bugzilla.redhat.com/show_bug.cgi?id=2284488"
  },
  "cvss3" : {
    "cvss3_base_score" : "5.9",
    "cvss3_scoring_vector" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:H",
    "status" : "verified"
  },
  "cwe" : "CWE-457",
  "details" : [ "In the Linux kernel, the following vulnerability has been resolved:\nnsh: Restore skb->{protocol,data,mac_header} for outer header in nsh_gso_segment().\nsyzbot triggered various splats (see [0] and links) by a crafted GSO\npacket of VIRTIO_NET_HDR_GSO_UDP layering the following protocols:\nETH_P_8021AD + ETH_P_NSH + ETH_P_IPV6 + IPPROTO_UDP\nNSH can encapsulate IPv4, IPv6, Ethernet, NSH, and MPLS.  As the inner\nprotocol can be Ethernet, NSH GSO handler, nsh_gso_segment(), calls\nskb_mac_gso_segment() to invoke inner protocol GSO handlers.\nnsh_gso_segment() does the following for the original skb before\ncalling skb_mac_gso_segment()\n1. reset skb->network_header\n2. save the original skb->{mac_heaeder,mac_len} in a local variable\n3. pull the NSH header\n4. resets skb->mac_header\n5. set up skb->mac_len and skb->protocol for the inner protocol.\nand does the following for the segmented skb\n6. set ntohs(ETH_P_NSH) to skb->protocol\n7. push the NSH header\n8. restore skb->mac_header\n9. set skb->mac_header + mac_len to skb->network_header\n10. restore skb->mac_len\nThere are two problems in 6-7 and 8-9.\n(a)\nAfter 6 & 7, skb->data points to the NSH header, so the outer header\n(ETH_P_8021AD in this case) is stripped when skb is sent out of netdev.\nAlso, if NSH is encapsulated by NSH + Ethernet (so NSH-Ethernet-NSH),\nskb_pull() in the first nsh_gso_segment() will make skb->data point\nto the middle of the outer NSH or Ethernet header because the Ethernet\nheader is not pulled by the second nsh_gso_segment().\n(b)\nWhile restoring skb->{mac_header,network_header} in 8 & 9,\nnsh_gso_segment() does not assume that the data in the linear\nbuffer is shifted.\nHowever, udp6_ufo_fragment() could shift the data and change\nskb->mac_header accordingly as demonstrated by syzbot.\nIf this happens, even the restored skb->mac_header points to\nthe middle of the outer header.\nIt seems nsh_gso_segment() has never worked with outer headers so far.\nAt the end of nsh_gso_segment(), the outer header must be restored for\nthe segmented skb, instead of the NSH header.\nTo do that, let's calculate the outer header position relatively from\nthe inner header and set skb->{data,mac_header,protocol} properly.\n[0]:\nBUG: KMSAN: uninit-value in ipvlan_process_outbound drivers/net/ipvlan/ipvlan_core.c:524 [inline]\nBUG: KMSAN: uninit-value in ipvlan_xmit_mode_l3 drivers/net/ipvlan/ipvlan_core.c:602 [inline]\nBUG: KMSAN: uninit-value in ipvlan_queue_xmit+0xf44/0x16b0 drivers/net/ipvlan/ipvlan_core.c:668\nipvlan_process_outbound drivers/net/ipvlan/ipvlan_core.c:524 [inline]\nipvlan_xmit_mode_l3 drivers/net/ipvlan/ipvlan_core.c:602 [inline]\nipvlan_queue_xmit+0xf44/0x16b0 drivers/net/ipvlan/ipvlan_core.c:668\nipvlan_start_xmit+0x5c/0x1a0 drivers/net/ipvlan/ipvlan_main.c:222\n__netdev_start_xmit include/linux/netdevice.h:4989 [inline]\nnetdev_start_xmit include/linux/netdevice.h:5003 [inline]\nxmit_one net/core/dev.c:3547 [inline]\ndev_hard_start_xmit+0x244/0xa10 net/core/dev.c:3563\n__dev_queue_xmit+0x33ed/0x51c0 net/core/dev.c:4351\ndev_queue_xmit include/linux/netdevice.h:3171 [inline]\npacket_xmit+0x9c/0x6b0 net/packet/af_packet.c:276\npacket_snd net/packet/af_packet.c:3081 [inline]\npacket_sendmsg+0x8aef/0x9f10 net/packet/af_packet.c:3113\nsock_sendmsg_nosec net/socket.c:730 [inline]\n__sock_sendmsg net/socket.c:745 [inline]\n__sys_sendto+0x735/0xa10 net/socket.c:2191\n__do_sys_sendto net/socket.c:2203 [inline]\n__se_sys_sendto net/socket.c:2199 [inline]\n__x64_sys_sendto+0x125/0x1c0 net/socket.c:2199\ndo_syscall_x64 arch/x86/entry/common.c:52 [inline]\ndo_syscall_64+0xcf/0x1e0 arch/x86/entry/common.c:83\nentry_SYSCALL_64_after_hwframe+0x63/0x6b\nUninit was created at:\nslab_post_alloc_hook mm/slub.c:3819 [inline]\nslab_alloc_node mm/slub.c:3860 [inline]\n__do_kmalloc_node mm/slub.c:3980 [inline]\n__kmalloc_node_track_caller+0x705/0x1000 mm/slub.c:4001\nkmalloc_reserve+0x249/0x4a0 net/core/skbuff.c:582\n__\n---truncated---" ],
  "affected_release" : [ {
    "product_name" : "Red Hat Enterprise Linux 8",
    "release_date" : "2024-08-08T00:00:00Z",
    "advisory" : "RHSA-2024:5102",
    "cpe" : "cpe:/a:redhat:enterprise_linux:8::nfv",
    "package" : "kernel-rt-0:4.18.0-553.16.1.rt7.357.el8_10"
  }, {
    "product_name" : "Red Hat Enterprise Linux 8",
    "release_date" : "2024-08-08T00:00:00Z",
    "advisory" : "RHSA-2024:5101",
    "cpe" : "cpe:/o:redhat:enterprise_linux:8",
    "package" : "kernel-0:4.18.0-553.16.1.el8_10"
  }, {
    "product_name" : "Red Hat Enterprise Linux 9",
    "release_date" : "2024-11-12T00:00:00Z",
    "advisory" : "RHSA-2024:9315",
    "cpe" : "cpe:/a:redhat:enterprise_linux:9",
    "package" : "kernel-0:5.14.0-503.11.1.el9_5"
  }, {
    "product_name" : "Red Hat Enterprise Linux 9",
    "release_date" : "2024-11-12T00:00:00Z",
    "advisory" : "RHSA-2024:9315",
    "cpe" : "cpe:/o:redhat:enterprise_linux:9",
    "package" : "kernel-0:5.14.0-503.11.1.el9_5"
  }, {
    "product_name" : "Red Hat Enterprise Linux 9.4 Extended Update Support",
    "release_date" : "2025-06-11T00:00:00Z",
    "advisory" : "RHSA-2025:8796",
    "cpe" : "cpe:/a:redhat:rhel_eus:9.4",
    "package" : "kernel-0:5.14.0-427.72.1.el9_4"
  } ],
  "package_state" : [ {
    "product_name" : "Red Hat Enterprise Linux 6",
    "fix_state" : "Not affected",
    "package_name" : "kernel",
    "cpe" : "cpe:/o:redhat:enterprise_linux:6"
  }, {
    "product_name" : "Red Hat Enterprise Linux 7",
    "fix_state" : "Not affected",
    "package_name" : "kernel",
    "cpe" : "cpe:/o:redhat:enterprise_linux:7"
  }, {
    "product_name" : "Red Hat Enterprise Linux 7",
    "fix_state" : "Not affected",
    "package_name" : "kernel-rt",
    "cpe" : "cpe:/o:redhat:enterprise_linux:7"
  }, {
    "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-2024-36933\nhttps://nvd.nist.gov/vuln/detail/CVE-2024-36933\nhttps://lore.kernel.org/linux-cve-announce/2024053042-CVE-2024-36933-444e@gregkh/T" ],
  "name" : "CVE-2024-36933",
  "csaw" : false
}