Lucene search

K
cve416baaa9-dc9f-4396-8d5f-8c081fb06d67CVE-2021-47318
HistoryMay 21, 2024 - 3:15 p.m.

CVE-2021-47318

2024-05-2115:15:19
416baaa9-dc9f-4396-8d5f-8c081fb06d67
web.nvd.nist.gov
27
linux
kernel
vulnerability
scale_freq_data
use-after-free
rcu
synchronize_rcu
nvd

6.8 Medium

AI Score

Confidence

Low

0.0004 Low

EPSS

Percentile

9.0%

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

arch_topology: Avoid use-after-free for scale_freq_data

Currently topology_scale_freq_tick() (which gets called from
scheduler_tick()) may end up using a pointer to “struct
scale_freq_data”, which was previously cleared by
topology_clear_scale_freq_source(), as there is no protection in place
here. The users of topology_clear_scale_freq_source() though needs a
guarantee that the previously cleared scale_freq_data isn’t used
anymore, so they can free the related resources.

Since topology_scale_freq_tick() is called from scheduler tick, we don’t
want to add locking in there. Use the RCU update mechanism instead
(which is already used by the scheduler’s utilization update path) to
guarantee race free updates here.

synchronize_rcu() makes sure that all RCU critical sections that started
before it is called, will finish before it returns. And so the callers
of topology_clear_scale_freq_source() don’t need to worry about their
callback getting called anymore.

Affected configurations

Vulners
Node
linuxlinux_kernelRange5.135.13.4
OR
linuxlinux_kernelRange5.14.0

CNA Affected

[
  {
    "product": "Linux",
    "vendor": "Linux",
    "defaultStatus": "unaffected",
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "programFiles": [
      "drivers/base/arch_topology.c"
    ],
    "versions": [
      {
        "version": "01e055c120a4",
        "lessThan": "ccdf7e073170",
        "status": "affected",
        "versionType": "git"
      },
      {
        "version": "01e055c120a4",
        "lessThan": "83150f5d05f0",
        "status": "affected",
        "versionType": "git"
      }
    ]
  },
  {
    "product": "Linux",
    "vendor": "Linux",
    "defaultStatus": "affected",
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "programFiles": [
      "drivers/base/arch_topology.c"
    ],
    "versions": [
      {
        "version": "5.13",
        "status": "affected"
      },
      {
        "version": "0",
        "lessThan": "5.13",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "5.13.4",
        "lessThanOrEqual": "5.13.*",
        "status": "unaffected",
        "versionType": "custom"
      },
      {
        "version": "5.14",
        "lessThanOrEqual": "*",
        "status": "unaffected",
        "versionType": "original_commit_for_fix"
      }
    ]
  }
]

6.8 Medium

AI Score

Confidence

Low

0.0004 Low

EPSS

Percentile

9.0%