Not ratedCVE-2023-54271

    Linux Kernel: NULL Pointer Dereference (CVE-2023-54271)

    Published Last modified Sources: SUSE, Debian LTS, BSI, Siemens ProductCERT, Ubuntu, Red Hat, CVE.org, EUVD

    What is affected, what to do

    Update Linux Kernel to version 5.15.210, Linux Kernel to version 6.1.176, Linux Kernel to version 6.4.16.

    Affected
    • Linux Kernel lt 5.4..5.15.210
    • Linux Kernel lt 5.16..6.1.176
    • Linux Kernel lt 6.2..6.4.16
    • Linux Kernel lt 6.5..6.5.3
    Fixed in
    • Linux Kernel 5.15.210
    • Linux Kernel 6.1.176
    • Linux Kernel 6.4.16
    • Linux Kernel 6.5.3
    • Linux Kernel 6.6

    Not sure whether and how you are affected? Ask a question about this vulnerability

    Metrics

    —

    Priority

    No value is available for this vulnerability.

    0.0

    CVSS v3

    Severity Not rated on the scale from 0 to 10.

    Source: SUSE, Debian LTS, BSI, Siemens ProductCERT, Ubuntu, Red Hat, CVE.org, EUVD

    0.2 %

    EPSS score

    Low — model estimates < 1% exploitation likelihood.

    Source: FIRST EPSS, percentile 11.7

    Show all metrics
    Severity
    Not rated
    Priority (0–325)

    The priority score is a consolidated metric that condenses several individual signals into a single, action-guiding ranking: technical severity (CVSS), exploitation likelihood (EPSS), known-exploited status (KEV) and the context of the affected asset. The aim is to answer the only truly important question in vulnerability management: what first?

    Read in glossary
    14.21 Methodology
    Exploit maturity

    An exploit is code or a technique that specifically uses a concrete vulnerability to force unintended behaviour — such as executing code or escalating privileges. It is the tool that turns a theoretical flaw into a practical attack.

    Read in glossary
    no public PoC known
    CVSS v3

    CVSS is the globally established, open standard for assessing the technical severity of a vulnerability on a scale from 0 to 10. It describes how easily a flaw can be exploited and what damage it can cause — but not how likely its actual exploitation is. CVSS and the complementary EPSS deliberately answer different questions.

    Read in glossary
    0.0
    EPSS score

    The EPSS score is the absolute model output for an individual vulnerability: the estimated probability of real-world exploitation within the next 30 days, expressed as a value between 0 and 1 (i.e. 0 % to 100 %). A score of 0.42 means „the model estimates a 42 % chance of real-world exploitation within 30 days“.

    Read in glossary
    0.2 %
    Low — model estimates < 1% exploitation likelihood.
    EPSS percentile

    The EPSS percentile is the relative position of a vulnerability within all EPSS-scored CVEs, expressed as a value between 0 and 1. A percentile of 0.90 means „this CVE has a higher EPSS score than 90 % of all other scored CVEs“. Unlike the EPSS score, it is not a probability — but a positioning within a ranking.

    Read in glossary
    11.7
    Elevated — this CVE ranks above at least 10% of all CVEs scored today.
    KEV status

    The KEV catalogue is a list maintained by the US authority CISA of vulnerabilities for which active exploitation in the wild has been confirmed. It answers not the question „how severe?“ but „is it already being attacked?“ — thereby sharply prioritising patching.

    Read in glossary
    —
    Published

    Detection rules

    No NEOSEC detection rule is available for this vulnerability yet.

    Classification under NIS2 and CRA

    Rule-based classification from exploitation status and severity. It does not replace a case-by-case assessment.

    NIS2

    NIS2 is EU Directive (EU) 2022/2555 to raise the level of cybersecurity across the Union. It substantially broadens obligations compared with the first NIS directive: more sectors, mandatory risk management, staged reporting duties and personal accountability of senior management.

    Read in glossary
    Handle the vulnerability in regular vulnerability handling under Art. 21(2)(e) NIS2.
    CRA

    The CRA is EU Regulation (EU) 2024/2847 setting horizontal cybersecurity requirements for „products with digital elements“ — from industrial controllers and software to connected consumer devices. For the first time manufacturers must ensure security across the entire product lifecycle, handle vulnerabilities and provide security updates.

    Read in glossary
    From 11.12.2027, Annex I Part II CRA requires manufacturers of affected products with digital elements to handle vulnerabilities without delay and provide security updates.
    ISO/IEC 27001

    ISO/IEC 27001 is the internationally leading standard for an information security management system (ISMS). It describes a risk-based, process-oriented framework to systematically plan, implement, review and improve information security.

    Read in glossary
    Control A.8.8, management of technical vulnerabilities: assess relevance to your systems, plan remediation and keep evidence.

    Description

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

    blk-cgroup: Fix NULL deref caused by blkg_policy_data being installed before init

    blk-iocost sometimes causes the following crash:

    BUG: kernel NULL pointer dereference, address: 00000000000000e0 ... RIP: 0010:_raw_spin_lock+0x17/0x30 Code: be 01 02 00 00 e8 79 38 39 ff 31 d2 89 d0 5d c3 0f 1f 00 0f 1f 44 00 00 55 48 89 e5 65 ff 05 48 d0 34 7e b9 01 00 00 00 31 c0 0f b1 0f 75 02 5d c3 89 c6 e8 ea 04 00 00 5d c3 0f 1f 84 00 00 RSP: 0018:ffffc900023b3d40 EFLAGS: 00010046 RAX: 0000000000000000 RBX: 00000000000000e0 RCX: 0000000000000001 RDX: ffffc900023b3d20 RSI: ffffc900023b3cf0 RDI: 00000000000000e0 RBP: ffffc900023b3d40 R08: ffffc900023b3c10 R09: 0000000000000003 R10: 0000000000000064 R11: 000000000000000a R12: ffff888102337000 R13: fffffffffffffff2 R14: ffff88810af408c8 R15: ffff8881070c3600 FS: 00007faaaf364fc0(0000) GS:ffff88842fdc0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000000000e0 CR3: 00000001097b1000 CR4: 0000000000350ea0 Call Trace: ioc_weight_write+0x13d/0x410 cgroup_file_write+0x7a/0x130 kernfs_fop_write_iter+0xf5/0x170 vfs_write+0x298/0x370 ksys_write+0x5f/0xb0 __x64_sys_write+0x1b/0x20 do_syscall_64+0x3d/0x80 entry_SYSCALL_64_after_hwframe+0x46/0xb0

    This happens because iocg->ioc is NULL. The field is initialized by ioc_pd_init() and never cleared. The NULL deref is caused by blkcg_activate_policy() installing blkg_policy_data before initializing it.

    blkcg_activate_policy() was doing the following:

    1. Allocate pd's for all existing blkg's and install them in blkg->pd[].
    2. Initialize all pd's.
    3. Online all pd's.

    blkcg_activate_policy() only grabs the queue_lock and may release and re-acquire the lock as allocation may need to sleep. ioc_weight_write() grabs blkcg->lock and iterates all its blkg's. The two can race and if ioc_weight_write() runs during #1 or between #1 and #2, it can encounter a pd which is not initialized yet, leading to crash.

    The crash can be reproduced with the following script:

    #!/bin/bash

    echo +io > /sys/fs/cgroup/cgroup.subtree_control systemd-run --unit touch-sda --scope dd if=/dev/sda of=/dev/null bs=1M count=1 iflag=direct echo 100 > /sys/fs/cgroup/system.slice/io.weight bash -c "echo '8:0 enable=1' > /sys/fs/cgroup/io.cost.qos" & sleep .2 echo 100 > /sys/fs/cgroup/system.slice/io.weight

    with the following patch applied:

    diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index fc49be622e05..38d671d5e10c 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -1553,6 +1553,12 @@ int blkcg_activate_policy(struct gendisk *disk, const struct blkcg_policy *pol) pd->online = false; }

    •   if (system_state == SYSTEM_RUNNING) {
      
    •           spin_unlock_irq(&q->queue_lock);
      
    •           ssleep(1);
      
    •           spin_lock_irq(&q->queue_lock);
      
    •   }
      
    • /* all allocated, init in the same order */ if (pol->pd_init_fn) list_for_each_entry_reverse(blkg, &q->blkg_list, q_node)

    I don't see a reason why all pd's should be allocated, initialized and onlined together. The only ordering requirement is that parent blkgs to be initialized and onlined before children, which is guaranteed from the walking order. Let's fix the bug by allocating, initializing and onlining pd for each blkg and holding blkcg->lock over initialization and onlining. This ensures that an installed blkg is always fully initialized and onlined removing the the race window.

    Source: suse_csaf, Debian LTS Advisories, BSI WID Portal, BSI CSAF, siemens_advisory, Ubuntu Security Notices, redhat_csaf, cvelistv5, NVD (NIST), ENISA EUVD

    Affected products

    The following versions are affected. Older releases of the same product line are also vulnerable unless stated otherwise.

    Affected products
    Affected versionsFixed in
    LinuxLinux
    • 6.5 – < 6.5.3
    • —
    • 5.4 – < 5.15.210
    • 5.16 – < 6.1.176
    • 6.2 – < 6.4.16
    • 6.5.3
    • 6.6
    • 5.15.210
    • 6.1.176
    • 6.4.16
    IBMDataPower Gateway
    • 10.6.0.0-10.6.0.8
    • 10.5.0.0-10.5.0.20
    • —
    • —
    SiemensSIMATIC S7
    • 1500 TM MFP V1.1.1 GNU/Linux subsystem
    • —

    Vendors and products

    Affected operating systems

    Affected operating systems
    Linuxdebianlinuxbookworm
    Linuxdebianlinux-6.1bullseye
    Linuxubuntulinux-gcp-5.15focal

    References & sources

    Changes to this CVE

    Who changed this CVE and when: NVD (analysis, affected products, CVSS), the CVE publisher (CNA) and additional providers such as CISA (ADP).

    1. Record modifiedLinux

      Show 10 original changes
      Individual changes of this event as published by NVD
      TypeActionBeforeAfter
      Referenceadded
      —
      https://git.kernel.org/stable/c/33f0370bb7ce15a59d72a4d8a05421d334a04add
      Referenceadded
      —
      https://git.kernel.org/stable/c/7d63c6f9765339dcfc34b7365ced7c518012e4fe
      Referenceadded
      —
      https://git.kernel.org/stable/c/da6cc648c1f570290af1ddbe6b7ca3d91b1d6db9
      Referenceadded
      —
      https://git.kernel.org/stable/c/e39ef7880d1057b2ebcdb013405f4d84a257db23
      Referenceadded
      —
      https://git.kernel.org/stable/c/ec14a87ee1999b19d8b7ed0fa95fea80644624ae
      Referenceremoved
      https://git.kernel.org/stable/c/33f0370bb7ce15a59d72a4d8a05421d334a04add
      —
      Referenceremoved
      https://git.kernel.org/stable/c/7d63c6f9765339dcfc34b7365ced7c518012e4fe
      —
      Referenceremoved
      https://git.kernel.org/stable/c/da6cc648c1f570290af1ddbe6b7ca3d91b1d6db9
      —
      Referenceremoved
      https://git.kernel.org/stable/c/e39ef7880d1057b2ebcdb013405f4d84a257db23
      —
      Referenceremoved
      https://git.kernel.org/stable/c/ec14a87ee1999b19d8b7ed0fa95fea80644624ae
      —

      Source identifier: 416baaa9-dc9f-4396-8d5f-8c081fb06d67

    2. Record modifiedSiemens ADP

      Show 2 original changes
      Individual changes of this event as published by NVD
      TypeActionBeforeAfter
      Affected versions (publisher)added
      —
      New affected value received. <a href="https://github.com/CVEProject/cvelistV5/blob/main/cves/2023/54xxx/CVE-2023-54271.json">CVE-2023-54271</a>
      Referenceadded
      —
      https://cert-portal.siemens.com/productcert/html/ssa-784472.html

      Source identifier: 0b142b55-0307-4c5a-b3c9-f314f3fb7c5e

    3. Record modifiedLinux

      Show 3 original changes
      Individual changes of this event as published by NVD
      TypeActionBeforeAfter
      Referenceadded
      —
      https://git.kernel.org/stable/c/33f0370bb7ce15a59d72a4d8a05421d334a04add
      Referenceadded
      —
      https://git.kernel.org/stable/c/da6cc648c1f570290af1ddbe6b7ca3d91b1d6db9
      Affected versions (publisher)changed
      Linux, Linux
      Linux, Linux

      Source identifier: 416baaa9-dc9f-4396-8d5f-8c081fb06d67

    Embed badge

    Show the severity and KEV status of this vulnerability on your site – with a link back here. The image is updated hourly.

    Badge preview for CVE-2023-54271
    <a href="https://intel.neosec.eu/en/cve/CVE-2023-54271"><img src="https://intel.neosec.eu/badge/cve/CVE-2023-54271.svg?lang=en" alt="CVE-2023-54271 – NEOSEC Intel" height="20"></a>