Skip to content
Heist/ feed
Back to feed
UnratedFix available

net: xfrm: unexport __init-annotated xfrm4_protocol_init()

Type: advisorySources: OSV

In the Linux kernel, the following vulnerability has been resolved: net: xfrm: unexport __init-annotated xfrm4_protocol_init() EXPORT_SYMBOL and __init is a bad combination because the .init.text section is freed up after the initialization. Hence, modules cannot use symbols annotated __init. The access to a freed symbol may end up with kernel panic. modpost used to detect it, but it has been broken for a decade. Recently, I fixed modpost so it started to warn it again, then this showed up in linux-next builds. There are two ways to fix it: - Remove __init - Remove EXPORT_SYMBOL I chose the latter for this case because the only in-tree call-site, net/ipv4/xfrm4_policy.c is never compiled as modular. (CONFIG_XFRM is boolean)

Products
Kernel
Affected versions
Not specified
Fixed versions
4.14.283, 4.19.247, 4.9.318, 5.10.122, 5.15.47, 5.17.15, 5.18.4, 5.4.198
CVEs
CVE-2022-49345
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 12:43 UTC · Revision 1

Source evidence

net: xfrm: unexport __init-annotated xfrm4_protocol_init()

core-osv · Original source

Published 26 Feb 2025, 02:11 UTC

In the Linux kernel, the following vulnerability has been resolved: net: xfrm: unexport __init-annotated xfrm4_protocol_init() EXPORT_SYMBOL and __init is a bad combination because the .init.text section is freed up after the initialization. Hence, modules cannot use symbols annotated __init. The access to a freed symbol may end up with kernel panic. modpost used to detect it, but it has been broken for a decade. Recently, I fixed modpost so it started to warn it again, then this showed up in linux-next builds. There are two ways to fix it: - Remove __init - Remove EXPORT_SYMBOL I chose the latter for this case because the only in-tree call-site, net/ipv4/xfrm4_policy.c is never compiled as modular. (CONFIG_XFRM is boolean)

osv:CVE-2022-49345

Kernel

Fixed versions: 4.9.318, 4.14.283, 4.19.247, 5.4.198, 5.10.122, 5.15.47, 5.17.15, 5.18.4

Complete source record
{
  "id": "a2a191e2c3d082cba20352340af08c55307503ad7aef8ffb32438bb1e5c03b74",
  "url": "https://osv.dev/vulnerability/CVE-2022-49345",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "net: xfrm: unexport __init-annotated xfrm4_protocol_init()",
    "summary": "In the Linux kernel, the following vulnerability has been resolved: net: xfrm: unexport __init-annotated xfrm4_protocol_init() EXPORT_SYMBOL and __init is a bad combination because the .init.text section is freed up after the initialization. Hence, modules cannot use symbols annotated __init. The access to a freed symbol may end up with kernel panic. modpost used to detect it, but it has been broken for a decade. Recently, I fixed modpost so it started to warn it again, then this showed up in linux-next builds. There are two ways to fix it: - Remove __init - Remove EXPORT_SYMBOL I chose the latter for this case because the only in-tree call-site, net/ipv4/xfrm4_policy.c is never compiled as modular. (CONFIG_XFRM is boolean)",
    "evidence": "osv:CVE-2022-49345",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "4.9.318",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "4.14.283",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "4.19.247",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.4.198",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.10.122",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.15.47",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.17.15",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.18.4",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "CVE-2022-49345",
      "aliases": [
        "CVE-2022-49345"
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "2f32b51b609faea1e40bb8c5bd305f1351740936"
                },
                {
                  "fixed": "c58d82a1264813e69119c13e9804e2e60b664ad5"
                },
                {
                  "fixed": "e53cd3814504b2cadaba4d5a8a07eeea9ddacd03"
                },
                {
                  "fixed": "31f3c6a4dcd3260a386e62cef2d5b36e902600a1"
                },
                {
                  "fixed": "ef6d2354de238b065d8799c80da4be9a6af18e39"
                },
                {
                  "fixed": "be3884d5cd04ccd58294b83a02d70b7c5fca19d3"
                },
                {
                  "fixed": "85a055c03691e51499123194a14a0c249cf33227"
                },
                {
                  "fixed": "e04d59cfe0c0129df7aba7ef7bb17b96be2a64f2"
                },
                {
                  "fixed": "2b253fbc9f7b5db18d716436bdcf8ecef09fd63d"
                },
                {
                  "fixed": "4a388f08d8784af48f352193d2b72aaf167a57a1"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49345.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "3.15.0"
                },
                {
                  "fixed": "4.9.318"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "4.10.0"
                },
                {
                  "fixed": "4.14.283"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "4.15.0"
                },
                {
                  "fixed": "4.19.247"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "4.20.0"
                },
                {
                  "fixed": "5.4.198"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.5.0"
                },
                {
                  "fixed": "5.10.122"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.11.0"
                },
                {
                  "fixed": "5.15.47"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.16.0"
                },
                {
                  "fixed": "5.17.15"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.18.0"
                },
                {
                  "fixed": "5.18.4"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-49345.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:29.109618422Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/2b253fbc9f7b5db18d716436bdcf8ecef09fd63d",
        "https://git.kernel.org/stable/c/31f3c6a4dcd3260a386e62cef2d5b36e902600a1",
        "https://git.kernel.org/stable/c/4a388f08d8784af48f352193d2b72aaf167a57a1",
        "https://git.kernel.org/stable/c/85a055c03691e51499123194a14a0c249cf33227",
        "https://git.kernel.org/stable/c/be3884d5cd04ccd58294b83a02d70b7c5fca19d3",
        "https://git.kernel.org/stable/c/c58d82a1264813e69119c13e9804e2e60b664ad5",
        "https://git.kernel.org/stable/c/e04d59cfe0c0129df7aba7ef7bb17b96be2a64f2",
        "https://git.kernel.org/stable/c/e53cd3814504b2cadaba4d5a8a07eeea9ddacd03",
        "https://git.kernel.org/stable/c/ef6d2354de238b065d8799c80da4be9a6af18e39",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49345.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2022-49345",
        "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
      ],
      "provider_metadata": {
        "cna_assigner": "Linux",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/49xxx/CVE-2022-49345.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2022-49345",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 495516,
  "published_at": "2025-02-26T02:11:00.976+00:00"
}