Updated:
Description:
In the Linux kernel, the following vulnerability has been resolved: ipvlan: Fix out-of-bound bugs caused by unset skb->mac_header If an AF_PACKET socket is used to send packets through ipvlan and the default xmit function of the AF_PACKET socket is changed from dev_queue_xmit() to packet_direct_xmit() via setsockopt() with the option name of PACKET_QDISC_BYPASS, the skb->mac_header may not be reset and remains as the initial value of 65535, this may trigger slab-out-of-bounds bugs as following: ================================================================= UG: KASAN: slab-out-of-bounds in ipvlan_xmit_mode_l2+0xdb/0x330 [ipvlan] PU: 2 PID: 1768 Comm: raw_send Kdump: loaded Not tainted 6.0.0-rc4+ #6 ardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-1.fc33 all Trace: print_address_description.constprop.0+0x1d/0x160 print_report.cold+0x4f/0x112 kasan_report+0xa3/0x130 ipvlan_xmit_mode_l2+0xdb/0x330 [ipvlan] ipvlan_start_xmit+0x29/0xa0 [ipvlan] __dev_direct_xmit+0x2e2/0x380 packet_direct_xmit+0x22/0x60 packet_snd+0x7c9/0xc40 sock_sendmsg+0x9a/0xa0 __sys_sendto+0x18a/0x230 __x64_sys_sendto+0x74/0x90 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x63/0xcd The root cause is: 1. packet_snd() only reset skb->mac_header when sock->type is SOCK_RAW and skb->protocol is not specified as in packet_parse_headers() 2. packet_direct_xmit() doesn't reset skb->mac_header as dev_queue_xmit() In this case, skb->mac_header is 65535 when ipvlan_xmit_mode_l2() is called. So when ipvlan_xmit_mode_l2() gets mac header with eth_hdr() which use "skb->head + skb->mac_header", out-of-bound access occurs. This patch replaces eth_hdr() with skb_eth_hdr() in ipvlan_xmit_mode_l2() and reset mac header in multicast to solve this out-of-bound bug.
CVSS3: 7.7
OS | Vendor version | Errata |
---|---|---|
Ubuntu 18.04 | 4.15.0-204.215 | USN-5854-1 |
Ubuntu 18.04 AWS | 4.15.0-1150.163 | USN-5854-1 |
Amazon Linux 1 | 4.14.299-152.520.amzn1 | ALAS-2022-1645 |
Amazon Linux 2 | 4.14.296-222.539.amzn2 | ALAS-2022-1876 |
Ubuntu 18.04 HWE Focal | 5.4.0-136.153~18.04.1 | USN-5791-1 |
Debian 10 | 4.19.260-1 | DLA-3131-1 |
Debian 10 cloud | 4.19.260-1 | DLA-3131-1 |
Ubuntu 20.04 | 5.4.0-136.153 | USN-5791-1 |
Ubuntu 18.04 AWS Focal | 5.4.0-1093.102~18.04.2 | USN-5791-1 |
Ubuntu 18.04 Azure Focal | 5.4.0-1100.106~18.04.1 | USN-5791-3 |
Ubuntu 20.04 AWS | 5.4.0-1093.101 | USN-5791-1 |
Ubuntu 16.04 HWE ESM | 4.15.0-206.217~16.04.1 | USN-5883-1 |
Ubuntu 16.04 GCP ESM | 4.15.0-1146.162~16.04.1 | USN-6007-1 |
Ubuntu 16.04 AWS HWE ESM | 4.15.0-1151.164~16.04.1 | USN-5919-1 |
Ubuntu 16.04 Azure ESM | 4.15.0-1162.177~16.04.1 | USN-5975-1 |
Ubuntu 22.04 | 5.15.0-57.63 | USN-5792-1 |
Ubuntu 22.04 AWS | 5.15.0-1027.31 | USN-5792-2 |
Ubuntu 22.04 Azure | 5.15.0-1030.37 | USN-5792-2 |
Amazon Linux 2 5.4 | 5.4.217-126.408.amzn2 | ALASKERNEL-5.4-2022-037 |
Amazon Linux 2 5.10 | 5.10.147-133.644.amzn2 | ALASKERNEL-5.10-2022-021 |
OS | Original kernel version | State |
---|---|---|
Ubuntu 18.04 | |
Planned |
Ubuntu 18.04 AWS | |
Planned |
Amazon Linux 1 | |
Planned |
Amazon Linux 2 | |
Planned |
Ubuntu 18.04 HWE Focal | |
Planned |
Debian 10 | |
Planned |
Debian 10 cloud | |
Planned |
Ubuntu 20.04 | |
Planned |
Ubuntu 18.04 AWS Focal | |
Planned |
Ubuntu 18.04 Azure Focal | |
Planned |
Ubuntu 20.04 AWS | |
Planned |
Ubuntu 16.04 HWE ESM | |
Planned |
Ubuntu 16.04 GCP ESM | |
Planned |
Ubuntu 16.04 AWS HWE ESM | |
Planned |
Ubuntu 16.04 Azure ESM | |
Planned |
Ubuntu 22.04 | |
Planned |
Ubuntu 22.04 AWS | |
Planned |
Ubuntu 22.04 Azure | |
Planned |
Amazon Linux 2 5.4 | |
Planned |
Amazon Linux 2 5.10 | |
Planned |