CVE-2022-50004: xfrm: policy: fix metadata dst->dev xmit null pointer dereference

Published Jun 18, 2025
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

xfrm: policy: fix metadata dst->dev xmit null pointer dereference

When we try to transmit an skb with metadatadst attached (i.e. dst->dev == NULL) through xfrm interface we can hit a null pointer dereference[1] in xfrmixmit2() -> xfrmlookupwithifid() due to the check for a loopback skb device when there's no policy which dereferences dst->dev unconditionally. Not having dst->dev can be interepreted as it not being a loopback device, so just add a check for a null dstorig->dev.

With this fix xfrm interface's Tx error counters go up as usual.

[1] net-next calltrace captured via netconsole: BUG: kernel NULL pointer dereference, address: 00000000000000c0 #PF: supervisor read access in kernel mode #PF: errorcode(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP CPU: 1 PID: 7231 Comm: ping Kdump: loaded Not tainted 5.19.0+ #24 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.0-1.fc36 04/01/2014 RIP: 0010:xfrmlookupwithifid+0x5eb/0xa60 Code: 8d 74 24 38 e8 26 a4 37 00 48 89 c1 e9 12 fc ff ff 49 63 ed 41 83 fd be 0f 85 be 01 00 00 41 be ff ff ff ff 45 31 ed 48 8b 03 <f6> 80 c0 00 00 00 08 75 0f 41 80 bc 24 19 0d 00 00 01 0f 84 1e 02 RSP: 0018:ffffb0db82c679f0 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffffd0db7fcad430 RCX: ffffb0db82c67a10 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffb0db82c67a80 RBP: ffffb0db82c67a80 R08: ffffb0db82c67a14 R09: 0000000000000000 R10: 0000000000000000 R11: ffff8fa449667dc8 R12: ffffffff966db880 R13: 0000000000000000 R14: 00000000ffffffff R15: 0000000000000000 FS: 00007ff35c83f000(0000) GS:ffff8fa478480000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000000000c0 CR3: 000000001ebb7000 CR4: 0000000000350ee0 Call Trace: <TASK> xfrmixmit+0xde/0x460 ? tcfbpfact+0x13d/0x2a0 devhardstartxmit+0x72/0x1e0 devqueuexmit+0x251/0xd30 ipfinishoutput2+0x140/0x550 ippushpendingframes+0x56/0x80 rawsendmsg+0x663/0x10a0 ? trychargememcg+0x3fd/0x7a0 ? modmemcglruvecstate+0x93/0x110 ? socksendmsg+0x30/0x40 socksendmsg+0x30/0x40 syssendto+0xeb/0x130 ? handlemmfault+0xae/0x280 ? douseraddrfault+0x1e7/0x680 ? kvmreadandresetapfflags+0x3b/0x50 x64syssendto+0x20/0x30 dosyscall64+0x34/0x80 entrySYSCALL64afterhwframe+0x46/0xb0 RIP: 0033:0x7ff35cac1366 Code: eb 0b 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b8 0f 1f 00 41 89 ca 64 8b 04 25 18 00 00 00 85 c0 75 11 b8 2c 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 72 c3 90 55 48 83 ec 30 44 89 4c 24 2c 4c 89 RSP: 002b:00007fff738e4028 EFLAGS: 00000246 ORIGRAX: 000000000000002c RAX: ffffffffffffffda RBX: 00007fff738e57b0 RCX: 00007ff35cac1366 RDX: 0000000000000040 RSI: 0000557164e4b450 RDI: 0000000000000003 RBP: 0000557164e4b450 R08: 00007fff738e7a2c R09: 0000000000000010 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000040 R13: 00007fff738e5770 R14: 00007fff738e4030 R15: 0000001d00000001 </TASK> Modules linked in: netconsole veth brnetfilter bridge bonding virtionet [last unloaded: netconsole] CR2: 00000000000000c0

Affected Software

116 affected componentsFixes available
Linux Kernel>=5.19.0
Linux Linux kernel>=5.10.118<5.10.140
Linux Linux kernel>=5.15<5.15.64
Linux Linux kernel>=5.16<5.19.6
Linux Linux kernel=6.0-rc1
Linux Linux kernel=6.0-rc2
ubuntu/linux-hwe-edge*
ubuntu/linux-aws-5.0*
ubuntu/linux-aws-5.3*
ubuntu/linux-azure*
ubuntu/linux-azure-5.3*
ubuntu/linux-azure-edge*
ubuntu/linux-gcp*
ubuntu/linux-gcp-5.3*
ubuntu/linux-gke-4.15*
ubuntu/linux-gke-5.4*
ubuntu/linux-gkeop-5.4*
ubuntu/linux-hwe*
ubuntu/linux-hwe-edge*
ubuntu/linux-oem*
ubuntu/linux-oracle-5.0*
ubuntu/linux-oracle-5.3*
ubuntu/linux-aws-5.15<5.15.0-1023.27~20.04.1
5.15.0-1023.27~20.04.1
ubuntu/linux-azure-5.15<5.15.0-1023.29~20.04.1
5.15.0-1023.29~20.04.1
ubuntu/linux-gcp-5.15<5.15.0-1022.29~20.04.1
5.15.0-1022.29~20.04.1
ubuntu/linux-hwe-5.15<5.15.0-53.59~20.04.1
5.15.0-53.59~20.04.1
ubuntu/linux-intel-iotg-5.15<5.15.0-1018.23~20.04.1
5.15.0-1018.23~20.04.1
ubuntu/linux-lowlatency-hwe-5.15<5.15.0-53.59~20.04.1
5.15.0-53.59~20.04.1
ubuntu/linux-oracle-5.15<5.15.0-1022.28~20.04.1
5.15.0-1022.28~20.04.1
ubuntu/linux-riscv-5.15<5.15.0-1023.27~20.04.1
5.15.0-1023.27~20.04.1
ubuntu/linux-aws-5.11*
ubuntu/linux-aws-5.13*
ubuntu/linux-aws-5.8*
ubuntu/linux-azure-5.11*
ubuntu/linux-azure-5.13*
ubuntu/linux-azure-5.8*
ubuntu/linux-azure-fde*
ubuntu/linux-gcp-5.11*
ubuntu/linux-gcp-5.13*
ubuntu/linux-gcp-5.8*
ubuntu/linux-gke*
ubuntu/linux-gke-5.15*
ubuntu/linux-gkeop*
ubuntu/linux-gkeop-5.15*
ubuntu/linux-hwe-5.11*
ubuntu/linux-hwe-5.13*
ubuntu/linux-hwe-5.8*
ubuntu/linux-intel-5.13*
ubuntu/linux-oem-5.10*
ubuntu/linux-oem-5.13*
ubuntu/linux-oem-5.6*
ubuntu/linux-oracle-5.11*
ubuntu/linux-oracle-5.13*
ubuntu/linux-oracle-5.8*
ubuntu/linux-raspi2*
ubuntu/linux-riscv*
ubuntu/linux-riscv-5.11*
ubuntu/linux-riscv-5.8*
ubuntu/linux<5.15.0-53.59
5.15.0-53.59
ubuntu/linux-allwinner-5.19*
ubuntu/linux-aws<5.15.0-1023.27
5.15.0-1023.27
ubuntu/linux-aws-5.19*
ubuntu/linux-aws-6.2*
ubuntu/linux-aws-6.5*
ubuntu/linux-azure<5.15.0-1023.29
5.15.0-1023.29
ubuntu/linux-azure-5.19*
ubuntu/linux-azure-6.2*
ubuntu/linux-azure-6.5*
ubuntu/linux-azure-fde<5.15.0-1024.30.1
5.15.0-1024.30.1
ubuntu/linux-azure-fde-5.19*
ubuntu/linux-azure-fde-6.2*
ubuntu/linux-gcp<5.15.0-1022.29
5.15.0-1022.29
ubuntu/linux-gcp-5.19*
ubuntu/linux-gcp-6.2*
ubuntu/linux-gcp-6.5*
ubuntu/linux-gke<5.15.0-1020.25
5.15.0-1020.25
ubuntu/linux-gkeop<5.15.0-1008.12
5.15.0-1008.12
ubuntu/linux-hwe-5.19*
ubuntu/linux-hwe-6.2*
ubuntu/linux-hwe-6.5*
ubuntu/linux-ibm<5.15.0-1018.21
5.15.0-1018.21
ubuntu/linux-intel-iot-realtime*
ubuntu/linux-intel-iotg<5.15.0-1018.23
5.15.0-1018.23
ubuntu/linux-kvm<5.15.0-1021.26
5.15.0-1021.26
ubuntu/linux-lowlatency<5.15.0-53.59
5.15.0-53.59
ubuntu/linux-lowlatency-hwe-5.19*
ubuntu/linux-lowlatency-hwe-6.2*
ubuntu/linux-lowlatency-hwe-6.5*
ubuntu/linux-nvidia<5.15.0-1015.15
5.15.0-1015.15
ubuntu/linux-nvidia-6.2*
ubuntu/linux-nvidia-6.5*
ubuntu/linux-oem-5.17*
ubuntu/linux-oem-6.0*
ubuntu/linux-oem-6.1*
ubuntu/linux-oem-6.5*
ubuntu/linux-oracle<5.15.0-1022.28
5.15.0-1022.28
ubuntu/linux-oracle-6.5*
ubuntu/linux-raspi<5.15.0-1018.20
5.15.0-1018.20
ubuntu/linux-realtime*
ubuntu/linux-riscv*
ubuntu/linux-riscv-5.19*
ubuntu/linux-riscv-6.5*
ubuntu/linux-starfive-5.19*
ubuntu/linux-starfive-6.2*
ubuntu/linux-starfive-6.5*
ubuntu/linux-realtime<5.15.0-1025.28
5.15.0-1025.28
ubuntu/linux-raspi-realtime*
ubuntu/linux-realtime*
ubuntu/linux-riscv*
linux/kernel>=5.10.118<5.10.140
5.10.140
linux/kernel>=5.15.0<5.15.64
5.15.64
linux/kernel>=5.16.0<5.19.6
5.19.6
debian/linux<6.0.2-1
6.0.2-1
debian/linux<6.0.2-1
6.0.2-1
debian/linux<6.0.2-1
6.0.2-1
debian/linux
5.10.140-16.0.2-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade ubuntu/linux-aws-5.15 to a version that resolves this vulnerability.

    Fixed in 5.15.0-1023.27~20.04.1
  2. Upgrade

    Upgrade ubuntu/linux-azure-5.15 to a version that resolves this vulnerability.

    Fixed in 5.15.0-1023.29~20.04.1
  3. Upgrade

    Upgrade ubuntu/linux-gcp-5.15 to a version that resolves this vulnerability.

    Fixed in 5.15.0-1022.29~20.04.1
  4. Upgrade

    Upgrade ubuntu/linux-hwe-5.15 to a version that resolves this vulnerability.

    Fixed in 5.15.0-53.59~20.04.1
  5. Upgrade

    Upgrade ubuntu/linux-intel-iotg-5.15 to a version that resolves this vulnerability.

    Fixed in 5.15.0-1018.23~20.04.1
  6. Upgrade

    Upgrade ubuntu/linux-lowlatency-hwe-5.15 to a version that resolves this vulnerability.

    Fixed in 5.15.0-53.59~20.04.1
  7. Upgrade

    Upgrade ubuntu/linux-oracle-5.15 to a version that resolves this vulnerability.

    Fixed in 5.15.0-1022.28~20.04.1
  8. Upgrade

    Upgrade ubuntu/linux-riscv-5.15 to a version that resolves this vulnerability.

    Fixed in 5.15.0-1023.27~20.04.1
  9. Upgrade

    Upgrade ubuntu/linux to a version that resolves this vulnerability.

    Fixed in 5.15.0-53.59
  10. Upgrade

    Upgrade ubuntu/linux-aws to a version that resolves this vulnerability.

    Fixed in 5.15.0-1023.27
  11. Upgrade

    Upgrade ubuntu/linux-azure to a version that resolves this vulnerability.

    Fixed in 5.15.0-1023.29
  12. Upgrade

    Upgrade ubuntu/linux-azure-fde to a version that resolves this vulnerability.

    Fixed in 5.15.0-1024.30.1
  13. Upgrade

    Upgrade ubuntu/linux-gcp to a version that resolves this vulnerability.

    Fixed in 5.15.0-1022.29
  14. Upgrade

    Upgrade ubuntu/linux-gke to a version that resolves this vulnerability.

    Fixed in 5.15.0-1020.25
  15. Upgrade

    Upgrade ubuntu/linux-gkeop to a version that resolves this vulnerability.

    Fixed in 5.15.0-1008.12
  16. Upgrade

    Upgrade ubuntu/linux-ibm to a version that resolves this vulnerability.

    Fixed in 5.15.0-1018.21
  17. Upgrade

    Upgrade ubuntu/linux-intel-iotg to a version that resolves this vulnerability.

    Fixed in 5.15.0-1018.23
  18. Upgrade

    Upgrade ubuntu/linux-kvm to a version that resolves this vulnerability.

    Fixed in 5.15.0-1021.26
  19. Upgrade

    Upgrade ubuntu/linux-lowlatency to a version that resolves this vulnerability.

    Fixed in 5.15.0-53.59
  20. Upgrade

    Upgrade ubuntu/linux-nvidia to a version that resolves this vulnerability.

    Fixed in 5.15.0-1015.15
  21. Upgrade

    Upgrade ubuntu/linux-oracle to a version that resolves this vulnerability.

    Fixed in 5.15.0-1022.28
  22. Upgrade

    Upgrade ubuntu/linux-raspi to a version that resolves this vulnerability.

    Fixed in 5.15.0-1018.20
  23. Upgrade

    Upgrade ubuntu/linux-realtime to a version that resolves this vulnerability.

    Fixed in 5.15.0-1025.28
  24. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 5.10.140
  25. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 5.15.64
  26. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 5.19.6
  27. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.0.2-1
  28. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 5.10.140-1Fixed in 6.0.2-1
  29. Compensating control

    In xfrm_lookup_with_ifid(), check whether dst_orig->dev is NULL before using it in the loopback-device check.

Event History

Jun 18, 2025
CVE Published
via MITRE·11:01 AM
Data Sourced
via MITRE·11:01 AM
Description
Data Sourced
via OSV·11:01 AM
DescriptionAffected Software
Event
via OSV·11:15 AM
Data Sourced
via NVD·11:15 AM
Description
Data Sourced
via Red Hat·12:04 PM
DescriptionSeverityAffected Software
Nov 14, 2025
Data Sourced
via NVD·04:00 PM
RemedySeverityWeaknessAffected Software
Nov 3, 2026
Data Sourced
via OSV·02:32 PM
Severity
Nov 11, 2026
Updated
via OSV·09:37 AM
Affected Software
Nov 12, 2026
Updated
via OSV·05:23 PM
Affected Software
Nov 17, 2026
Updated
via OSV·07:00 AM
Affected Software

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203