Skip to content

[fips-9.2] veth: Fix use after free in XDP_REDIRECT - #264

Merged
dvdgomez merged 1 commit into
fips-9-compliant/5.14.0-284.30.1from
dgomez-fips-9-compliant/VULN-67449
May 15, 2025
Merged

[fips-9.2] veth: Fix use after free in XDP_REDIRECT#264
dvdgomez merged 1 commit into
fips-9-compliant/5.14.0-284.30.1from
dgomez-fips-9-compliant/VULN-67449

Conversation

@dvdgomez

Copy link
Copy Markdown

jira VULN-67449
cve CVE-2023-53107

commit-author Shawn Bohrer <sbohrer@cloudflare.com> commit 7c10131803e45269ddc6c817f19ed649110f3cae
Commit 718a18a0c8a6 ("veth: Rework veth_xdp_rcv_skb in order to accept non-linear skb") introduced a bug where it tried to use pskb_expand_head() if the headroom was less than XDP_PACKET_HEADROOM. This however uses kmalloc to expand the head, which will later allow consume_skb() to free the skb while is it still in use by AF_XDP.
Previously if the headroom was less than XDP_PACKET_HEADROOM we continued on to allocate a new skb from pages so this restores that behavior.
BUG: KASAN: use-after-free in __xsk_rcv+0x18d/0x2c0 Read of size 78 at addr ffff888976250154 by task napi/iconduit-g/148640
CPU: 5 PID: 148640 Comm: napi/iconduit-g Kdump: loaded Tainted: G O 6.1.4-cloudflare-kasan-2023.1.2 #1
Hardware name: Quanta Computer Inc. QuantaPlex T41S-2U/S2S-MB, BIOS S2S_3B10.03 06/21/2018
Call Trace:
<TASK>
dump_stack_lvl+0x34/0x48
print_report+0x170/0x473
? __xsk_rcv+0x18d/0x2c0
kasan_report+0xad/0x130
? __xsk_rcv+0x18d/0x2c0
kasan_check_range+0x149/0x1a0
memcpy+0x20/0x60
__xsk_rcv+0x18d/0x2c0
__xsk_map_redirect+0x1f3/0x490
? veth_xdp_rcv_skb+0x89c/0x1ba0 [veth]
xdp_do_redirect+0x5ca/0xd60
veth_xdp_rcv_skb+0x935/0x1ba0 [veth]
? __netif_receive_skb_list_core+0x671/0x920
? veth_xdp+0x670/0x670 [veth]
veth_xdp_rcv+0x304/0xa20 [veth]
? do_xdp_generic+0x150/0x150
? veth_xdp_rcv_one+0xde0/0xde0 [veth]
? _raw_spin_lock_bh+0xe0/0xe0
? newidle_balance+0x887/0xe30
? __perf_event_task_sched_in+0xdb/0x800
veth_poll+0x139/0x571 [veth]
? veth_xdp_rcv+0xa20/0xa20 [veth]
? _raw_spin_unlock+0x39/0x70
? finish_task_switch.isra.0+0x17e/0x7d0
? __switch_to+0x5cf/0x1070
? __schedule+0x95b/0x2640
? io_schedule_timeout+0x160/0x160
__napi_poll+0xa1/0x440
napi_threaded_poll+0x3d1/0x460
? __napi_poll+0x440/0x440
? __kthread_parkme+0xc6/0x1f0
? __napi_poll+0x440/0x440
kthread+0x2a2/0x340
? kthread_complete_and_exit+0x20/0x20
ret_from_fork+0x22/0x30
</TASK>
Freed by task 148640:
kasan_save_stack+0x23/0x50
kasan_set_track+0x21/0x30
kasan_save_free_info+0x2a/0x40
____kasan_slab_free+0x169/0x1d0
slab_free_freelist_hook+0xd2/0x190
__kmem_cache_free+0x1a1/0x2f0
skb_release_data+0x449/0x600
consume_skb+0x9f/0x1c0
veth_xdp_rcv_skb+0x89c/0x1ba0 [veth]
veth_xdp_rcv+0x304/0xa20 [veth]
veth_poll+0x139/0x571 [veth]
__napi_poll+0xa1/0x440
napi_threaded_poll+0x3d1/0x460
kthread+0x2a2/0x340
ret_from_fork+0x22/0x30
The buggy address belongs to the object at ffff888976250000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 340 bytes inside of
2048-byte region [ffff888976250000, ffff888976250800)
The buggy address belongs to the physical page:
page:00000000ae18262a refcount:2 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x976250 head:00000000ae18262a order:3 compound_mapcount:0 compound_pincount:0 flags: 0x2ffff800010200(slab|head|node=0|zone=2|lastcpupid=0x1ffff) raw: 002ffff800010200 0000000000000000 dead000000000122 ffff88810004cf00 raw: 0000000000000000 0000000080080008 00000002ffffffff 0000000000000000 page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff888976250000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888976250080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
> ffff888976250100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888976250180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888976250200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
Fixes: 718a18a0c8a6 ("veth: Rework veth_xdp_rcv_skb in order to accept non-linear skb")
Signed-off-by: Shawn Bohrer <sbohrer@cloudflare.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Acked-by: Toshiaki Makita <toshiaki.makita1@gmail.com>
Acked-by: Toke Høiland-Jørgensen <toke@kernel.org>
Link: https://lore.kernel.org/r/20230314153351.2201328-1-sbohrer@cloudflare.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit 7c10131803e45269ddc6c817f19ed649110f3cae)
Signed-off-by: David Gomez <dgomez@ciq.com>

Build Log

INSTALL /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/soc/sof/snd-sof.ko
INSTALL /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/soc/sof/xtensa/snd-sof-xtensa-dsp.ko
INSTALL /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/soundcore.ko
STRIP /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/soc/sof/snd-sof-utils.ko
SIGN /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/soc/sof/snd-sof-pci.ko
SIGN /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/soc/sof/snd-sof-probes.ko
INSTALL /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/synth/emux/snd-emux-synth.ko
SIGN /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/soc/sof/snd-sof-utils.ko
STRIP /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/soundcore.ko
STRIP /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/soc/sof/xtensa/snd-sof-xtensa-dsp.ko
STRIP /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/synth/emux/snd-emux-synth.ko
SIGN /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/soc/sof/xtensa/snd-sof-xtensa-dsp.ko
SIGN /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/soundcore.ko
INSTALL /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/synth/snd-util-mem.ko
INSTALL /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/6fire/snd-usb-6fire.ko
STRIP /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/soc/sof/snd-sof.ko
SIGN /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/synth/emux/snd-emux-synth.ko
INSTALL /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/bcd2000/snd-bcd2000.ko
STRIP /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/synth/snd-util-mem.ko
INSTALL /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/caiaq/snd-usb-caiaq.ko
STRIP /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/6fire/snd-usb-6fire.ko
STRIP /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/bcd2000/snd-bcd2000.ko
SIGN /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/synth/snd-util-mem.ko
SIGN /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/soc/sof/snd-sof.ko
SIGN /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/6fire/snd-usb-6fire.ko
INSTALL /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/hiface/snd-usb-hiface.ko
STRIP /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/caiaq/snd-usb-caiaq.ko
SIGN /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/bcd2000/snd-bcd2000.ko
INSTALL /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/line6/snd-usb-line6.ko
INSTALL /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/line6/snd-usb-pod.ko
STRIP /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/hiface/snd-usb-hiface.ko
SIGN /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/caiaq/snd-usb-caiaq.ko
SIGN /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/hiface/snd-usb-hiface.ko
STRIP /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/line6/snd-usb-line6.ko
STRIP /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/line6/snd-usb-pod.ko
INSTALL /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/line6/snd-usb-podhd.ko
INSTALL /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/line6/snd-usb-toneport.ko
INSTALL /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/line6/snd-usb-variax.ko
SIGN /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/line6/snd-usb-line6.ko
SIGN /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/line6/snd-usb-pod.ko
STRIP /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/line6/snd-usb-podhd.ko
STRIP /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/line6/snd-usb-toneport.ko
INSTALL /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/misc/snd-ua101.ko
STRIP /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/line6/snd-usb-variax.ko
INSTALL /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/snd-usb-audio.ko
INSTALL /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/snd-usbmidi-lib.ko
SIGN /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/line6/snd-usb-toneport.ko
SIGN /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/line6/snd-usb-podhd.ko
SIGN /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/line6/snd-usb-variax.ko
STRIP /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/misc/snd-ua101.ko
STRIP /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/snd-usbmidi-lib.ko
INSTALL /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/usx2y/snd-usb-us122l.ko
SIGN /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/misc/snd-ua101.ko
STRIP /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/snd-usb-audio.ko
INSTALL /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/usx2y/snd-usb-usx2y.ko
STRIP /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/usx2y/snd-usb-us122l.ko
SIGN /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/snd-usbmidi-lib.ko
INSTALL /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/virtio/virtio_snd.ko
INSTALL /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/x86/snd-hdmi-lpe-audio.ko
INSTALL /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/xen/snd_xen_front.ko
SIGN /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/usx2y/snd-usb-us122l.ko
SIGN /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/snd-usb-audio.ko
STRIP /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/usx2y/snd-usb-usx2y.ko
INSTALL /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/virt/lib/irqbypass.ko
STRIP /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/x86/snd-hdmi-lpe-audio.ko
STRIP /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/virtio/virtio_snd.ko
STRIP /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/xen/snd_xen_front.ko
SIGN /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/usb/usx2y/snd-usb-usx2y.ko
SIGN /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/virtio/virtio_snd.ko
STRIP /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/virt/lib/irqbypass.ko
SIGN /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/x86/snd-hdmi-lpe-audio.ko
SIGN /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/sound/xen/snd_xen_front.ko
SIGN /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+/kernel/virt/lib/irqbypass.ko
DEPMOD /lib/modules/5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+
[TIMER]{MODULES}: 14s
Making Install
sh ./arch/x86/boot/install.sh \
5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+ arch/x86/boot/bzImage \
System.map "/boot"
[TIMER]{INSTALL}: 54s
Checking kABI
Checking kABI
kABI check passed
Setting Default Kernel to /boot/vmlinuz-5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+ and Index to 0
The default is /boot/loader/entries/7b8cc30b1d5f42b0a4f1b1f8af928cf8-5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+.conf with index 0 and kernel /boot/vmlinuz-5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+
The default is /boot/loader/entries/7b8cc30b1d5f42b0a4f1b1f8af928cf8-5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+.conf with index 0 and kernel /boot/vmlinuz-5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab+
Generating grub configuration file ...
Adding boot menu entry for UEFI Firmware Settings ...
done
Hopefully Grub2.0 took everything ... rebooting after time metrices
[TIMER]{MRPROPER}: 23s
[TIMER]{BUILD}: 3309s
[TIMER]{MODULES}: 14s
[TIMER]{INSTALL}: 54s
[TIMER]{TOTAL} 3415s

Testing

5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab.log
5.14.0-284.30.1.el9_2.ciqfips.0.11.1.x86_64.log

# Before patch
$ grep ^ok 5.14.0-284.30.1.el9_2.ciqfips.0.11.1.x86_64.log | wc -l
301
# After patch
$ grep ^ok 5.14.0-dgomez-fips-9-compliant_VULN-67449-877c6d72a1ab.log | wc -l
304

Similar to #262

jira VULN-67449
cve CVE-2023-53107
commit-author Shawn Bohrer <sbohrer@cloudflare.com>
commit 7c10131
Commit 718a18a ("veth: Rework veth_xdp_rcv_skb in order
to accept non-linear skb") introduced a bug where it tried to
use pskb_expand_head() if the headroom was less than
XDP_PACKET_HEADROOM. This however uses kmalloc to expand the head,
which will later allow consume_skb() to free the skb while is it still
in use by AF_XDP.
Previously if the headroom was less than XDP_PACKET_HEADROOM we
continued on to allocate a new skb from pages so this restores that
behavior.
BUG: KASAN: use-after-free in __xsk_rcv+0x18d/0x2c0
Read of size 78 at addr ffff888976250154 by task napi/iconduit-g/148640
CPU: 5 PID: 148640 Comm: napi/iconduit-g Kdump: loaded Tainted: G O 6.1.4-cloudflare-kasan-2023.1.2 #1
Hardware name: Quanta Computer Inc. QuantaPlex T41S-2U/S2S-MB, BIOS S2S_3B10.03 06/21/2018
Call Trace:
<TASK>
dump_stack_lvl+0x34/0x48
print_report+0x170/0x473
? __xsk_rcv+0x18d/0x2c0
kasan_report+0xad/0x130
? __xsk_rcv+0x18d/0x2c0
kasan_check_range+0x149/0x1a0
memcpy+0x20/0x60
__xsk_rcv+0x18d/0x2c0
__xsk_map_redirect+0x1f3/0x490
? veth_xdp_rcv_skb+0x89c/0x1ba0 [veth]
xdp_do_redirect+0x5ca/0xd60
veth_xdp_rcv_skb+0x935/0x1ba0 [veth]
? __netif_receive_skb_list_core+0x671/0x920
? veth_xdp+0x670/0x670 [veth]
veth_xdp_rcv+0x304/0xa20 [veth]
? do_xdp_generic+0x150/0x150
? veth_xdp_rcv_one+0xde0/0xde0 [veth]
? _raw_spin_lock_bh+0xe0/0xe0
? newidle_balance+0x887/0xe30
? __perf_event_task_sched_in+0xdb/0x800
veth_poll+0x139/0x571 [veth]
? veth_xdp_rcv+0xa20/0xa20 [veth]
? _raw_spin_unlock+0x39/0x70
? finish_task_switch.isra.0+0x17e/0x7d0
? __switch_to+0x5cf/0x1070
? __schedule+0x95b/0x2640
? io_schedule_timeout+0x160/0x160
__napi_poll+0xa1/0x440
napi_threaded_poll+0x3d1/0x460
? __napi_poll+0x440/0x440
? __kthread_parkme+0xc6/0x1f0
? __napi_poll+0x440/0x440
kthread+0x2a2/0x340
? kthread_complete_and_exit+0x20/0x20
ret_from_fork+0x22/0x30
</TASK>
Freed by task 148640:
kasan_save_stack+0x23/0x50
kasan_set_track+0x21/0x30
kasan_save_free_info+0x2a/0x40
____kasan_slab_free+0x169/0x1d0
slab_free_freelist_hook+0xd2/0x190
__kmem_cache_free+0x1a1/0x2f0
skb_release_data+0x449/0x600
consume_skb+0x9f/0x1c0
veth_xdp_rcv_skb+0x89c/0x1ba0 [veth]
veth_xdp_rcv+0x304/0xa20 [veth]
veth_poll+0x139/0x571 [veth]
__napi_poll+0xa1/0x440
napi_threaded_poll+0x3d1/0x460
kthread+0x2a2/0x340
ret_from_fork+0x22/0x30
The buggy address belongs to the object at ffff888976250000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 340 bytes inside of
2048-byte region [ffff888976250000, ffff888976250800)
The buggy address belongs to the physical page:
page:00000000ae18262a refcount:2 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x976250
head:00000000ae18262a order:3 compound_mapcount:0 compound_pincount:0
flags: 0x2ffff800010200(slab|head|node=0|zone=2|lastcpupid=0x1ffff)
raw: 002ffff800010200 0000000000000000 dead000000000122 ffff88810004cf00
raw: 0000000000000000 0000000080080008 00000002ffffffff 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff888976250000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888976250080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
> ffff888976250100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888976250180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888976250200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
Fixes: 718a18a ("veth: Rework veth_xdp_rcv_skb in order to accept non-linear skb")
Signed-off-by: Shawn Bohrer <sbohrer@cloudflare.com>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Acked-by: Toshiaki Makita <toshiaki.makita1@gmail.com>
Acked-by: Toke Høiland-Jørgensen <toke@kernel.org>
Link: https://lore.kernel.org/r/20230314153351.2201328-1-sbohrer@cloudflare.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
(cherry picked from commit 7c10131)
Signed-off-by: David Gomez <dgomez@ciq.com>

@bmastbergenbmastbergen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥌

@PlaidCatPlaidCat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@dvdgomez
dvdgomez merged commit c9255b4 into fips-9-compliant/5.14.0-284.30.1May 15, 2025
@dvdgomez
dvdgomez deleted the dgomez-fips-9-compliant/VULN-67449 branch May 15, 2025 20:44
bmastbergen pushed a commit to bmastbergen/kernel-src-tree that referenced this pull request Aug 29, 2025
jira LE-1907
Rebuild_History Non-Buildable kernel-5.14.0-427.18.1.el9_4
commit-author Daniel Borkmann <daniel@iogearbox.net>
commit d1a783d
Add various tests to check maximum number of supported programs
being attached:
# ./vmtest.sh -- ./test_progs -t tc_opts
[...]
./test_progs -t tc_opts
[ 1.185325] bpf_testmod: loading out-of-tree module taints kernel.
[ 1.186826] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel
[ 1.270123] tsc: Refined TSC clocksource calibration: 3407.988 MHz
[ 1.272428] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x311fc932722, max_idle_ns: 440795381586 ns
[ 1.276408] clocksource: Switched to clocksource tsc
ctrliq#252 tc_opts_after:OK
ctrliq#253 tc_opts_append:OK
ctrliq#254 tc_opts_basic:OK
ctrliq#255 tc_opts_before:OK
ctrliq#256 tc_opts_chain_classic:OK
ctrliq#257 tc_opts_chain_mixed:OK
ctrliq#258 tc_opts_delete_empty:OK
ctrliq#259 tc_opts_demixed:OK
ctrliq#260 tc_opts_detach:OK
ctrliq#261 tc_opts_detach_after:OK
ctrliq#262 tc_opts_detach_before:OK
ctrliq#263 tc_opts_dev_cleanup:OK
ctrliq#264 tc_opts_invalid:OK
ctrliq#265 tc_opts_max:OK <--- (new test)
ctrliq#266 tc_opts_mixed:OK
ctrliq#267 tc_opts_prepend:OK
ctrliq#268 tc_opts_replace:OK
ctrliq#269 tc_opts_revision:OK
Summary: 18/0 PASSED, 0 SKIPPED, 0 FAILED
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20230929204121.20305-2-daniel@iogearbox.net
(cherry picked from commit d1a783d)
Signed-off-by: Jonathan Maple <jmaple@ciq.com>
bmastbergen pushed a commit to bmastbergen/kernel-src-tree that referenced this pull request Aug 29, 2025
jira LE-1907
Rebuild_History Non-Buildable kernel-5.14.0-427.18.1.el9_4
commit-author Daniel Borkmann <daniel@iogearbox.net>
commit f9b0879
Add a new test case which performs double query of the bpf_mprog through
libbpf API, but also via raw bpf(2) syscall. This is testing to gather
first the count and then in a subsequent probe the full information with
the program array without clearing passed structs in between.
# ./vmtest.sh -- ./test_progs -t tc_opts
[...]
./test_progs -t tc_opts
[ 1.398818] tsc: Refined TSC clocksource calibration: 3407.999 MHz
[ 1.400263] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x311fd336761, max_idle_ns: 440795243819 ns
[ 1.402734] clocksource: Switched to clocksource tsc
[ 1.426639] bpf_testmod: loading out-of-tree module taints kernel.
[ 1.428112] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel
ctrliq#252 tc_opts_after:OK
ctrliq#253 tc_opts_append:OK
ctrliq#254 tc_opts_basic:OK
ctrliq#255 tc_opts_before:OK
ctrliq#256 tc_opts_chain_classic:OK
ctrliq#257 tc_opts_chain_mixed:OK
ctrliq#258 tc_opts_delete_empty:OK
ctrliq#259 tc_opts_demixed:OK
ctrliq#260 tc_opts_detach:OK
ctrliq#261 tc_opts_detach_after:OK
ctrliq#262 tc_opts_detach_before:OK
ctrliq#263 tc_opts_dev_cleanup:OK
ctrliq#264 tc_opts_invalid:OK
ctrliq#265 tc_opts_max:OK
ctrliq#266 tc_opts_mixed:OK
ctrliq#267 tc_opts_prepend:OK
ctrliq#268 tc_opts_query:OK <--- (new test)
ctrliq#269 tc_opts_replace:OK
ctrliq#270 tc_opts_revision:OK
Summary: 19/0 PASSED, 0 SKIPPED, 0 FAILED
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/r/20231006220655.1653-4-daniel@iogearbox.net
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
(cherry picked from commit f9b0879)
Signed-off-by: Jonathan Maple <jmaple@ciq.com>
bmastbergen pushed a commit to bmastbergen/kernel-src-tree that referenced this pull request Aug 29, 2025
jira LE-1907
Rebuild_History Non-Buildable kernel-5.14.0-427.18.1.el9_4
commit-author Daniel Borkmann <daniel@iogearbox.net>
commit 685446b
Add a new test case to query on an empty bpf_mprog and pass the revision
directly into expected_revision for attachment to assert that this does
succeed.
./test_progs -t tc_opts
[ 1.406778] tsc: Refined TSC clocksource calibration: 3407.990 MHz
[ 1.408863] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x311fcaf6eb0, max_idle_ns: 440795321766 ns
[ 1.412419] clocksource: Switched to clocksource tsc
[ 1.428671] bpf_testmod: loading out-of-tree module taints kernel.
[ 1.430260] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel
ctrliq#252 tc_opts_after:OK
ctrliq#253 tc_opts_append:OK
ctrliq#254 tc_opts_basic:OK
ctrliq#255 tc_opts_before:OK
ctrliq#256 tc_opts_chain_classic:OK
ctrliq#257 tc_opts_chain_mixed:OK
ctrliq#258 tc_opts_delete_empty:OK
ctrliq#259 tc_opts_demixed:OK
ctrliq#260 tc_opts_detach:OK
ctrliq#261 tc_opts_detach_after:OK
ctrliq#262 tc_opts_detach_before:OK
ctrliq#263 tc_opts_dev_cleanup:OK
ctrliq#264 tc_opts_invalid:OK
ctrliq#265 tc_opts_max:OK
ctrliq#266 tc_opts_mixed:OK
ctrliq#267 tc_opts_prepend:OK
ctrliq#268 tc_opts_query:OK
ctrliq#269 tc_opts_query_attach:OK <--- (new test)
ctrliq#270 tc_opts_replace:OK
ctrliq#271 tc_opts_revision:OK
Summary: 20/0 PASSED, 0 SKIPPED, 0 FAILED
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/r/20231006220655.1653-6-daniel@iogearbox.net
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
(cherry picked from commit 685446b)
Signed-off-by: Jonathan Maple <jmaple@ciq.com>
bmastbergen pushed a commit to bmastbergen/kernel-src-tree that referenced this pull request Aug 29, 2025
jira LE-1907
Rebuild_History Non-Buildable kernel-5.14.0-427.18.1.el9_4
commit-author Daniel Borkmann <daniel@iogearbox.net>
commit 2451630
Add several new test cases which assert corner cases on the mprog query
mechanism, for example, around passing in a too small or a larger array
than the current count.
./test_progs -t tc_opts
ctrliq#252 tc_opts_after:OK
ctrliq#253 tc_opts_append:OK
ctrliq#254 tc_opts_basic:OK
ctrliq#255 tc_opts_before:OK
ctrliq#256 tc_opts_chain_classic:OK
ctrliq#257 tc_opts_chain_mixed:OK
ctrliq#258 tc_opts_delete_empty:OK
ctrliq#259 tc_opts_demixed:OK
ctrliq#260 tc_opts_detach:OK
ctrliq#261 tc_opts_detach_after:OK
ctrliq#262 tc_opts_detach_before:OK
ctrliq#263 tc_opts_dev_cleanup:OK
ctrliq#264 tc_opts_invalid:OK
ctrliq#265 tc_opts_max:OK
ctrliq#266 tc_opts_mixed:OK
ctrliq#267 tc_opts_prepend:OK
ctrliq#268 tc_opts_query:OK
ctrliq#269 tc_opts_query_attach:OK
ctrliq#270 tc_opts_replace:OK
ctrliq#271 tc_opts_revision:OK
Summary: 20/0 PASSED, 0 SKIPPED, 0 FAILED
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Alan Maguire <alan.maguire@oracle.com>
Link: https://lore.kernel.org/bpf/20231017081728.24769-1-daniel@iogearbox.net
(cherry picked from commit 2451630)
Signed-off-by: Jonathan Maple <jmaple@ciq.com>
PlaidCat added a commit that referenced this pull request Oct 14, 2025
jira LE-4405
cve CVE-2022-50228
Rebuild_History Non-Buildable kernel-4.18.0-553.79.1.el8_10
commit-author Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
commit f17c31c
Don't BUG/WARN on interrupt injection due to GIF being cleared,
since it's trivial for userspace to force the situation via
KVM_SET_VCPU_EVENTS (even if having at least a WARN there would be correct
for KVM internally generated injections).
kernel BUG at arch/x86/kvm/svm/svm.c:3386!
invalid opcode: 0000 [#1] SMP
CPU: 15 PID: 926 Comm: smm_test Not tainted 5.17.0-rc3+ #264
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
RIP: 0010:svm_inject_irq+0xab/0xb0 [kvm_amd]
Code: <0f> 0b 0f 1f 00 0f 1f 44 00 00 80 3d ac b3 01 00 00 55 48 89 f5 53
RSP: 0018:ffffc90000b37d88 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff88810a234ac0 RCX: 0000000000000006
RDX: 0000000000000000 RSI: ffffc90000b37df7 RDI: ffff88810a234ac0
RBP: ffffc90000b37df7 R08: ffff88810a1fa410 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: ffff888109571000 R14: ffff88810a234ac0 R15: 0000000000000000
FS: 0000000001821380(0000) GS:ffff88846fdc0000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f74fc550008 CR3: 000000010a6fe000 CR4: 0000000000350ea0
Call Trace:
<TASK>
inject_pending_event+0x2f7/0x4c0 [kvm]
kvm_arch_vcpu_ioctl_run+0x791/0x17a0 [kvm]
kvm_vcpu_ioctl+0x26d/0x650 [kvm]
__x64_sys_ioctl+0x82/0xb0
do_syscall_64+0x3b/0xc0
entry_SYSCALL_64_after_hwframe+0x44/0xae
</TASK>
Fixes: 219b65d ("KVM: SVM: Improve nested interrupt injection")
Cc: stable@vger.kernel.org
Co-developed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Message-Id: <35426af6e123cbe91ec7ce5132ce72521f02b1b5.1651440202.git.maciej.szmigiero@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit f17c31c)
Signed-off-by: Jonathan Maple <jmaple@ciq.com>
PlaidCat added a commit that referenced this pull request Oct 20, 2025
jira VULN-70726
jira VULN-70725
cve CVE-2022-50228
commit-author Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
commit f17c31c
Don't BUG/WARN on interrupt injection due to GIF being cleared,
since it's trivial for userspace to force the situation via
KVM_SET_VCPU_EVENTS (even if having at least a WARN there would be correct
for KVM internally generated injections).
kernel BUG at arch/x86/kvm/svm/svm.c:3386!
invalid opcode: 0000 [#1] SMP
CPU: 15 PID: 926 Comm: smm_test Not tainted 5.17.0-rc3+ #264
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
RIP: 0010:svm_inject_irq+0xab/0xb0 [kvm_amd]
Code: <0f> 0b 0f 1f 00 0f 1f 44 00 00 80 3d ac b3 01 00 00 55 48 89 f5 53
RSP: 0018:ffffc90000b37d88 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff88810a234ac0 RCX: 0000000000000006
RDX: 0000000000000000 RSI: ffffc90000b37df7 RDI: ffff88810a234ac0
RBP: ffffc90000b37df7 R08: ffff88810a1fa410 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: ffff888109571000 R14: ffff88810a234ac0 R15: 0000000000000000
FS: 0000000001821380(0000) GS:ffff88846fdc0000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f74fc550008 CR3: 000000010a6fe000 CR4: 0000000000350ea0
Call Trace:
<TASK>
inject_pending_event+0x2f7/0x4c0 [kvm]
kvm_arch_vcpu_ioctl_run+0x791/0x17a0 [kvm]
kvm_vcpu_ioctl+0x26d/0x650 [kvm]
__x64_sys_ioctl+0x82/0xb0
do_syscall_64+0x3b/0xc0
entry_SYSCALL_64_after_hwframe+0x44/0xae
</TASK>
Fixes: 219b65d ("KVM: SVM: Improve nested interrupt injection")
Cc: stable@vger.kernel.org
Co-developed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Message-Id: <35426af6e123cbe91ec7ce5132ce72521f02b1b5.1651440202.git.maciej.szmigiero@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit f17c31c)
Signed-off-by: Jonathan Maple <jmaple@ciq.com>
PlaidCat added a commit that referenced this pull request Oct 22, 2025
jira VULN-70727
cve CVE-2022-50228
commit-author Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
commit f17c31c
Don't BUG/WARN on interrupt injection due to GIF being cleared,
since it's trivial for userspace to force the situation via
KVM_SET_VCPU_EVENTS (even if having at least a WARN there would be correct
for KVM internally generated injections).
kernel BUG at arch/x86/kvm/svm/svm.c:3386!
invalid opcode: 0000 [#1] SMP
CPU: 15 PID: 926 Comm: smm_test Not tainted 5.17.0-rc3+ #264
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
RIP: 0010:svm_inject_irq+0xab/0xb0 [kvm_amd]
Code: <0f> 0b 0f 1f 00 0f 1f 44 00 00 80 3d ac b3 01 00 00 55 48 89 f5 53
RSP: 0018:ffffc90000b37d88 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff88810a234ac0 RCX: 0000000000000006
RDX: 0000000000000000 RSI: ffffc90000b37df7 RDI: ffff88810a234ac0
RBP: ffffc90000b37df7 R08: ffff88810a1fa410 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: ffff888109571000 R14: ffff88810a234ac0 R15: 0000000000000000
FS: 0000000001821380(0000) GS:ffff88846fdc0000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f74fc550008 CR3: 000000010a6fe000 CR4: 0000000000350ea0
Call Trace:
<TASK>
inject_pending_event+0x2f7/0x4c0 [kvm]
kvm_arch_vcpu_ioctl_run+0x791/0x17a0 [kvm]
kvm_vcpu_ioctl+0x26d/0x650 [kvm]
__x64_sys_ioctl+0x82/0xb0
do_syscall_64+0x3b/0xc0
entry_SYSCALL_64_after_hwframe+0x44/0xae
</TASK>
Fixes: 219b65d ("KVM: SVM: Improve nested interrupt injection")
Cc: stable@vger.kernel.org
Co-developed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Message-Id: <35426af6e123cbe91ec7ce5132ce72521f02b1b5.1651440202.git.maciej.szmigiero@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit f17c31c)
Signed-off-by: Jonathan Maple <jmaple@ciq.com>
roxanan1996 added a commit that referenced this pull request Oct 30, 2025
jira VULN-70723
cve CVE-2022-50228
commit-author Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
commit f17c31c
Don't BUG/WARN on interrupt injection due to GIF being cleared,
since it's trivial for userspace to force the situation via
KVM_SET_VCPU_EVENTS (even if having at least a WARN there would be correct
for KVM internally generated injections).
kernel BUG at arch/x86/kvm/svm/svm.c:3386!
invalid opcode: 0000 [#1] SMP
CPU: 15 PID: 926 Comm: smm_test Not tainted 5.17.0-rc3+ #264
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
RIP: 0010:svm_inject_irq+0xab/0xb0 [kvm_amd]
Code: <0f> 0b 0f 1f 00 0f 1f 44 00 00 80 3d ac b3 01 00 00 55 48 89 f5 53
RSP: 0018:ffffc90000b37d88 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff88810a234ac0 RCX: 0000000000000006
RDX: 0000000000000000 RSI: ffffc90000b37df7 RDI: ffff88810a234ac0
RBP: ffffc90000b37df7 R08: ffff88810a1fa410 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: ffff888109571000 R14: ffff88810a234ac0 R15: 0000000000000000
FS: 0000000001821380(0000) GS:ffff88846fdc0000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f74fc550008 CR3: 000000010a6fe000 CR4: 0000000000350ea0
Call Trace:
<TASK>
inject_pending_event+0x2f7/0x4c0 [kvm]
kvm_arch_vcpu_ioctl_run+0x791/0x17a0 [kvm]
kvm_vcpu_ioctl+0x26d/0x650 [kvm]
__x64_sys_ioctl+0x82/0xb0
do_syscall_64+0x3b/0xc0
entry_SYSCALL_64_after_hwframe+0x44/0xae
</TASK>
Fixes: 219b65d ("KVM: SVM: Improve nested interrupt injection")
Cc: stable@vger.kernel.org
Co-developed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Message-Id: <35426af6e123cbe91ec7ce5132ce72521f02b1b5.1651440202.git.maciej.szmigiero@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit f17c31c)
Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
roxanan1996 added a commit that referenced this pull request Oct 31, 2025
jira VULN-70723
cve CVE-2022-50228
commit-author Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
commit f17c31c
Don't BUG/WARN on interrupt injection due to GIF being cleared,
since it's trivial for userspace to force the situation via
KVM_SET_VCPU_EVENTS (even if having at least a WARN there would be correct
for KVM internally generated injections).
kernel BUG at arch/x86/kvm/svm/svm.c:3386!
invalid opcode: 0000 [#1] SMP
CPU: 15 PID: 926 Comm: smm_test Not tainted 5.17.0-rc3+ #264
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
RIP: 0010:svm_inject_irq+0xab/0xb0 [kvm_amd]
Code: <0f> 0b 0f 1f 00 0f 1f 44 00 00 80 3d ac b3 01 00 00 55 48 89 f5 53
RSP: 0018:ffffc90000b37d88 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff88810a234ac0 RCX: 0000000000000006
RDX: 0000000000000000 RSI: ffffc90000b37df7 RDI: ffff88810a234ac0
RBP: ffffc90000b37df7 R08: ffff88810a1fa410 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: ffff888109571000 R14: ffff88810a234ac0 R15: 0000000000000000
FS: 0000000001821380(0000) GS:ffff88846fdc0000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f74fc550008 CR3: 000000010a6fe000 CR4: 0000000000350ea0
Call Trace:
<TASK>
inject_pending_event+0x2f7/0x4c0 [kvm]
kvm_arch_vcpu_ioctl_run+0x791/0x17a0 [kvm]
kvm_vcpu_ioctl+0x26d/0x650 [kvm]
__x64_sys_ioctl+0x82/0xb0
do_syscall_64+0x3b/0xc0
entry_SYSCALL_64_after_hwframe+0x44/0xae
</TASK>
Fixes: 219b65d ("KVM: SVM: Improve nested interrupt injection")
Cc: stable@vger.kernel.org
Co-developed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Message-Id: <35426af6e123cbe91ec7ce5132ce72521f02b1b5.1651440202.git.maciej.szmigiero@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit f17c31c)
Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
Signed-off-by: Roxana Nicolescu <rnicolescu@ciq.com>
PlaidCat added a commit that referenced this pull request Oct 31, 2025
jira VULN-70726
jira VULN-70725
cve CVE-2022-50228
commit-author Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
commit f17c31c
Don't BUG/WARN on interrupt injection due to GIF being cleared,
since it's trivial for userspace to force the situation via
KVM_SET_VCPU_EVENTS (even if having at least a WARN there would be correct
for KVM internally generated injections).
kernel BUG at arch/x86/kvm/svm/svm.c:3386!
invalid opcode: 0000 [#1] SMP
CPU: 15 PID: 926 Comm: smm_test Not tainted 5.17.0-rc3+ #264
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
RIP: 0010:svm_inject_irq+0xab/0xb0 [kvm_amd]
Code: <0f> 0b 0f 1f 00 0f 1f 44 00 00 80 3d ac b3 01 00 00 55 48 89 f5 53
RSP: 0018:ffffc90000b37d88 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff88810a234ac0 RCX: 0000000000000006
RDX: 0000000000000000 RSI: ffffc90000b37df7 RDI: ffff88810a234ac0
RBP: ffffc90000b37df7 R08: ffff88810a1fa410 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: ffff888109571000 R14: ffff88810a234ac0 R15: 0000000000000000
FS: 0000000001821380(0000) GS:ffff88846fdc0000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f74fc550008 CR3: 000000010a6fe000 CR4: 0000000000350ea0
Call Trace:
<TASK>
inject_pending_event+0x2f7/0x4c0 [kvm]
kvm_arch_vcpu_ioctl_run+0x791/0x17a0 [kvm]
kvm_vcpu_ioctl+0x26d/0x650 [kvm]
__x64_sys_ioctl+0x82/0xb0
do_syscall_64+0x3b/0xc0
entry_SYSCALL_64_after_hwframe+0x44/0xae
</TASK>
Fixes: 219b65d ("KVM: SVM: Improve nested interrupt injection")
Cc: stable@vger.kernel.org
Co-developed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Message-Id: <35426af6e123cbe91ec7ce5132ce72521f02b1b5.1651440202.git.maciej.szmigiero@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit f17c31c)
Signed-off-by: Jonathan Maple <jmaple@ciq.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@dvdgomez@PlaidCat@bmastbergen