CVE-2021-47394 (GCVE-0-2021-47394)
Vulnerability from cvelistv5
Published
2024-05-21 15:03
Modified
2026-08-05 08:47
Summary
In the Linux kernel, the following vulnerability has been resolved: netfilter: nf_tables: unlink table before deleting it syzbot reports following UAF: BUG: KASAN: use-after-free in memcmp+0x18f/0x1c0 lib/string.c:955 nla_strcmp+0xf2/0x130 lib/nlattr.c:836 nft_table_lookup.part.0+0x1a2/0x460 net/netfilter/nf_tables_api.c:570 nft_table_lookup net/netfilter/nf_tables_api.c:4064 [inline] nf_tables_getset+0x1b3/0x860 net/netfilter/nf_tables_api.c:4064 nfnetlink_rcv_msg+0x659/0x13f0 net/netfilter/nfnetlink.c:285 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2504 Problem is that all get operations are lockless, so the commit_mutex held by nft_rcv_nl_event() isn't enough to stop a parallel GET request from doing read-accesses to the table object even after synchronize_rcu(). To avoid this, unlink the table first and store the table objects in on-stack scratch space.
Impacted products
Vendor Product Version
Linux Linux Version: 6001a930ce0378b62210d4f83583fc88a903d89d
Version: 6001a930ce0378b62210d4f83583fc88a903d89d
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2021-47394",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-05-28T18:27:57.258962Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-06-04T17:13:40.569Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      },
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-04T05:39:59.375Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/f65c73d3aabb87d4353e0bc4a718b5ae8c43fd04"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/a499b03bf36b0c2e3b958a381d828678ab0ffc5e"
          }
        ],
        "title": "CVE Program Container"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "net/netfilter/nf_tables_api.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "f65c73d3aabb87d4353e0bc4a718b5ae8c43fd04",
              "status": "affected",
              "version": "6001a930ce0378b62210d4f83583fc88a903d89d",
              "versionType": "git"
            },
            {
              "lessThan": "a499b03bf36b0c2e3b958a381d828678ab0ffc5e",
              "status": "affected",
              "version": "6001a930ce0378b62210d4f83583fc88a903d89d",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "net/netfilter/nf_tables_api.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "5.12"
            },
            {
              "lessThan": "5.12",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.14.*",
              "status": "unaffected",
              "version": "5.14.10",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "5.15",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.14.10",
                  "versionStartIncluding": "5.12",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.15",
                  "versionStartIncluding": "5.12",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nnetfilter: nf_tables: unlink table before deleting it\n\nsyzbot reports following UAF:\nBUG: KASAN: use-after-free in memcmp+0x18f/0x1c0 lib/string.c:955\n nla_strcmp+0xf2/0x130 lib/nlattr.c:836\n nft_table_lookup.part.0+0x1a2/0x460 net/netfilter/nf_tables_api.c:570\n nft_table_lookup net/netfilter/nf_tables_api.c:4064 [inline]\n nf_tables_getset+0x1b3/0x860 net/netfilter/nf_tables_api.c:4064\n nfnetlink_rcv_msg+0x659/0x13f0 net/netfilter/nfnetlink.c:285\n netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2504\n\nProblem is that all get operations are lockless, so the commit_mutex\nheld by nft_rcv_nl_event() isn\u0027t enough to stop a parallel GET request\nfrom doing read-accesses to the table object even after synchronize_rcu().\n\nTo avoid this, unlink the table first and store the table objects in\non-stack scratch space."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 7.8,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:L - The bug is reached only through the local nfnetlink/nftables control plane (NETLINK_NETFILTER create of an owned table, lockless GET*, and socket close triggering NETLINK_URELEASE\u2192nft_rcv_nl_event), not via remote packet processing.\nAC:L - The attacker controls both sides of the race\u2014creating an NFT_TABLE_F_OWNER table, spamming parallel RCU GET lookups from another netlink socket, and closing the owner socket\u2014so the post-synchronize_rcu free-while-still-linked window is reliably hittable.\nPR:L - nfnetlink_rcv() requires CAP_NET_ADMIN via netlink_net_capable() against the network namespace\u2019s user_ns, which an unprivileged user obtains with unshare -Urn; nftables is fully usable per-netns.\nUI:N - Exploitation needs no victim action; the attacker creates the owned table, drives concurrent GET requests, and closes their own netlink socket to trigger the UAF.\nS:U - Impact is confined to the local kernel privilege boundary (heap UAF / local privilege escalation) with no VM, IOMMU, or cross-authority escape.\nC:H - The race frees the still-linked nft_table (and its name/contents) while lockless nft_table_lookup reads it via nla_strcmp; this classic UAF enables heap spray and arbitrary kernel read primitives.\nI:H - __nft_release_table destroys the table and nested objects while concurrent GET paths can still observe and follow those pointers, yielding reclaimable UAF/write primitives suitable for control-flow hijacking.\nA:H - Use-after-free of the table during GET lookup causes kernel oops/panic (as shown by the KASAN report in memcmp/nla_strcmp), and the attacker can trigger it repeatedly."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T08:47:37.812Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/f65c73d3aabb87d4353e0bc4a718b5ae8c43fd04"
        },
        {
          "url": "https://git.kernel.org/stable/c/a499b03bf36b0c2e3b958a381d828678ab0ffc5e"
        }
      ],
      "title": "netfilter: nf_tables: unlink table before deleting it",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2021-47394",
    "datePublished": "2024-05-21T15:03:51.503Z",
    "dateReserved": "2024-05-21T14:58:30.814Z",
    "dateUpdated": "2026-08-05T08:47:37.812Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "vulnrichment": {
      "containers": "{\"adp\": [{\"title\": \"CVE Program Container\", \"references\": [{\"url\": \"https://git.kernel.org/stable/c/f65c73d3aabb87d4353e0bc4a718b5ae8c43fd04\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/a499b03bf36b0c2e3b958a381d828678ab0ffc5e\", \"tags\": [\"x_transferred\"]}], \"providerMetadata\": {\"orgId\": \"af854a3a-2127-422b-91ae-364da2661108\", \"shortName\": \"CVE\", \"dateUpdated\": \"2024-08-04T05:39:59.375Z\"}}, {\"metrics\": [{\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2021-47394\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"none\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2024-05-28T18:27:57.258962Z\"}}}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2024-05-28T18:28:02.403Z\"}, \"title\": \"CISA ADP Vulnrichment\"}], \"cna\": {\"title\": \"netfilter: nf_tables: unlink table before deleting it\", \"metrics\": [{\"cvssV3_1\": {\"version\": \"3.1\", \"baseScore\": 7.8, \"baseSeverity\": \"HIGH\", \"vectorString\": \"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H\"}, \"scenarios\": [{\"lang\": \"en\", \"value\": \"AV:L - The bug is reached only through the local nfnetlink/nftables control plane (NETLINK_NETFILTER create of an owned table, lockless GET*, and socket close triggering NETLINK_URELEASE\\u2192nft_rcv_nl_event), not via remote packet processing.\\nAC:L - The attacker controls both sides of the race\\u2014creating an NFT_TABLE_F_OWNER table, spamming parallel RCU GET lookups from another netlink socket, and closing the owner socket\\u2014so the post-synchronize_rcu free-while-still-linked window is reliably hittable.\\nPR:L - nfnetlink_rcv() requires CAP_NET_ADMIN via netlink_net_capable() against the network namespace\\u2019s user_ns, which an unprivileged user obtains with unshare -Urn; nftables is fully usable per-netns.\\nUI:N - Exploitation needs no victim action; the attacker creates the owned table, drives concurrent GET requests, and closes their own netlink socket to trigger the UAF.\\nS:U - Impact is confined to the local kernel privilege boundary (heap UAF / local privilege escalation) with no VM, IOMMU, or cross-authority escape.\\nC:H - The race frees the still-linked nft_table (and its name/contents) while lockless nft_table_lookup reads it via nla_strcmp; this classic UAF enables heap spray and arbitrary kernel read primitives.\\nI:H - __nft_release_table destroys the table and nested objects while concurrent GET paths can still observe and follow those pointers, yielding reclaimable UAF/write primitives suitable for control-flow hijacking.\\nA:H - Use-after-free of the table during GET lookup causes kernel oops/panic (as shown by the KASAN report in memcmp/nla_strcmp), and the attacker can trigger it repeatedly.\"}]}], \"affected\": [{\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"6001a930ce0378b62210d4f83583fc88a903d89d\", \"lessThan\": \"f65c73d3aabb87d4353e0bc4a718b5ae8c43fd04\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"6001a930ce0378b62210d4f83583fc88a903d89d\", \"lessThan\": \"a499b03bf36b0c2e3b958a381d828678ab0ffc5e\", \"versionType\": \"git\"}], \"programFiles\": [\"net/netfilter/nf_tables_api.c\"], \"defaultStatus\": \"unaffected\"}, {\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"5.12\"}, {\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"5.12\", \"versionType\": \"semver\"}, {\"status\": \"unaffected\", \"version\": \"5.14.10\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"5.14.*\"}, {\"status\": \"unaffected\", \"version\": \"5.15\", \"versionType\": \"original_commit_for_fix\", \"lessThanOrEqual\": \"*\"}], \"programFiles\": [\"net/netfilter/nf_tables_api.c\"], \"defaultStatus\": \"affected\"}], \"references\": [{\"url\": \"https://git.kernel.org/stable/c/f65c73d3aabb87d4353e0bc4a718b5ae8c43fd04\"}, {\"url\": \"https://git.kernel.org/stable/c/a499b03bf36b0c2e3b958a381d828678ab0ffc5e\"}], \"x_generator\": {\"engine\": \"bippy-1.2.0\"}, \"descriptions\": [{\"lang\": \"en\", \"value\": \"In the Linux kernel, the following vulnerability has been resolved:\\n\\nnetfilter: nf_tables: unlink table before deleting it\\n\\nsyzbot reports following UAF:\\nBUG: KASAN: use-after-free in memcmp+0x18f/0x1c0 lib/string.c:955\\n nla_strcmp+0xf2/0x130 lib/nlattr.c:836\\n nft_table_lookup.part.0+0x1a2/0x460 net/netfilter/nf_tables_api.c:570\\n nft_table_lookup net/netfilter/nf_tables_api.c:4064 [inline]\\n nf_tables_getset+0x1b3/0x860 net/netfilter/nf_tables_api.c:4064\\n nfnetlink_rcv_msg+0x659/0x13f0 net/netfilter/nfnetlink.c:285\\n netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2504\\n\\nProblem is that all get operations are lockless, so the commit_mutex\\nheld by nft_rcv_nl_event() isn\u0027t enough to stop a parallel GET request\\nfrom doing read-accesses to the table object even after synchronize_rcu().\\n\\nTo avoid this, unlink the table first and store the table objects in\\non-stack scratch space.\"}], \"cpeApplicability\": [{\"nodes\": [{\"negate\": false, \"cpeMatch\": [{\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.14.10\", \"versionStartIncluding\": \"5.12\"}, {\"criteria\": \"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\", \"vulnerable\": true, \"versionEndExcluding\": \"5.15\", \"versionStartIncluding\": \"5.12\"}], \"operator\": \"OR\"}]}], \"providerMetadata\": {\"orgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"shortName\": \"Linux\", \"dateUpdated\": \"2026-08-05T08:47:37.812Z\"}}}",
      "cveMetadata": "{\"cveId\": \"CVE-2021-47394\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2026-08-05T08:47:37.812Z\", \"dateReserved\": \"2024-05-21T14:58:30.814Z\", \"assignerOrgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"datePublished\": \"2024-05-21T15:03:51.503Z\", \"assignerShortName\": \"Linux\"}",
      "dataType": "CVE_RECORD",
      "dataVersion": "5.2"
    }
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…

Loading…