OESA-2025-1597

Source
https://www.openeuler.org/en/security/security-bulletins/detail/?id=openEuler-SA-2025-1597
Import Source
https://repo.openeuler.org/security/data/osv/OESA-2025-1597.json
JSON Data
https://api.test.osv.dev/v1/vulns/OESA-2025-1597
Upstream
Published
2025-06-06T14:04:05Z
Modified
2025-08-12T05:38:09.507213Z
Summary
kernel security update
Details

The Linux Kernel, the operating system core itself.

Security Fix(es):

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

cgroup: Use separate src/dst nodes when preloading css_sets for migration

Each cset (cssset) is pinned by its tasks. When we're moving tasks around across csets for a migration, we need to hold the source and destination csets to ensure that they don't go away while we're moving tasks about. This is done by linking cset->mgpreloadnode on either the mgctx->preloadedsrccsets or mgctx->preloadeddstcsets list. Using the same cset->mgpreload_node for both the src and dst lists was deemed okay as a cset can't be both the source and destination at the same time.

Unfortunately, this overloading becomes problematic when multiple tasks are involved in a migration and some of them are identity noop migrations while others are actually moving across cgroups. For example, this can happen with the following sequence on cgroup1:

#1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUNACOMMANDWHICHCREATESMULTIPLETHREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procs

the process including the group leader back into a. In this final migration, non-leader threads would be doing identity migration while the group leader is doing an actual one.

After #3, let's say the whole process was in cset A, and that after #4, the leader moves to cset B. Then, during #6, the following happens:

  1. cgroupmigrateadd_src() is called on B for the leader.

  2. cgroupmigrateadd_src() is called on A for the other threads.

  3. cgroupmigrateprepare_dst() is called. It scans the src list.

  4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mgpreloadnode is already busy.

  5. and then it notices A wants to migrate to A as it's an identity migration, it culls it by listdelinit()'ing its ->mgpreloadnode and putting references accordingly.

  6. The rest of migration takes place with B on the src list but nothing on the dst list.

This means that A isn't held while migration is in progress. If all tasks leave A before the migration finishes and the incoming task pins it, the cset will be destroyed leading to use-after-free.

This is caused by overloading cset->mgpreloadnode for both src and dst preload lists. We wanted to exclude the cset from the src list but ended up inadvertently excluding it from the dst list too.

This patch fixes the issue by separating out cset->mgpreloadnode into ->mgsrcpreloadnode and ->mgdstpreloadnode, so that the src and dst preloadings don't interfere with each other.(CVE-2022-49647)

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

fs/jfs: Prevent integer overflow in AG size calculation

The JFS filesystem calculates allocation group (AG) size using 1 << l2agsize in dbExtendFS(). When l2agsize exceeds 31 (possible with >2TB aggregates on 32-bit systems), this 32-bit shift operation causes undefined behavior and improper AG sizing.

On 32-bit architectures: - Left-shifting 1 by 32+ bits results in 0 due to integer overflow - This creates invalid AG sizes (0 or garbage values) in sbi->bmap->db_agsize - Subsequent block allocations would reference invalid AG structures - Could lead to: - Filesystem corruption during extend operations - Kernel crashes due to invalid memory accesses - Security vulnerabilities via malformed on-disk structures

Fix by casting to s64 before shifting: bmp->db_agsize = (s64)1 << l2agsize;

This ensures 64-bit arithmetic even on 32-bit architectures. The cast matches the data type of db_agsize (s64) and follows similar patterns in JFS block calculation code.

Found by Linux Verification Center (linuxtesting.org) with SVACE.(CVE-2025-37858)

Database specific
{
    "severity": "High"
}
References

Affected packages

openEuler:22.03-LTS-SP3 / kernel

Package

Name
kernel
Purl
pkg:rpm/openEuler/kernel&distro=openEuler-22.03-LTS-SP3

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
5.10.0-266.0.0.168.oe2203sp3

Ecosystem specific

{
    "aarch64": [
        "kernel-5.10.0-266.0.0.168.oe2203sp3.aarch64.rpm",
        "kernel-debuginfo-5.10.0-266.0.0.168.oe2203sp3.aarch64.rpm",
        "kernel-debugsource-5.10.0-266.0.0.168.oe2203sp3.aarch64.rpm",
        "kernel-devel-5.10.0-266.0.0.168.oe2203sp3.aarch64.rpm",
        "kernel-headers-5.10.0-266.0.0.168.oe2203sp3.aarch64.rpm",
        "kernel-source-5.10.0-266.0.0.168.oe2203sp3.aarch64.rpm",
        "kernel-tools-5.10.0-266.0.0.168.oe2203sp3.aarch64.rpm",
        "kernel-tools-debuginfo-5.10.0-266.0.0.168.oe2203sp3.aarch64.rpm",
        "kernel-tools-devel-5.10.0-266.0.0.168.oe2203sp3.aarch64.rpm",
        "perf-5.10.0-266.0.0.168.oe2203sp3.aarch64.rpm",
        "perf-debuginfo-5.10.0-266.0.0.168.oe2203sp3.aarch64.rpm",
        "python3-perf-5.10.0-266.0.0.168.oe2203sp3.aarch64.rpm",
        "python3-perf-debuginfo-5.10.0-266.0.0.168.oe2203sp3.aarch64.rpm"
    ],
    "x86_64": [
        "kernel-5.10.0-266.0.0.168.oe2203sp3.x86_64.rpm",
        "kernel-debuginfo-5.10.0-266.0.0.168.oe2203sp3.x86_64.rpm",
        "kernel-debugsource-5.10.0-266.0.0.168.oe2203sp3.x86_64.rpm",
        "kernel-devel-5.10.0-266.0.0.168.oe2203sp3.x86_64.rpm",
        "kernel-headers-5.10.0-266.0.0.168.oe2203sp3.x86_64.rpm",
        "kernel-source-5.10.0-266.0.0.168.oe2203sp3.x86_64.rpm",
        "kernel-tools-5.10.0-266.0.0.168.oe2203sp3.x86_64.rpm",
        "kernel-tools-debuginfo-5.10.0-266.0.0.168.oe2203sp3.x86_64.rpm",
        "kernel-tools-devel-5.10.0-266.0.0.168.oe2203sp3.x86_64.rpm",
        "perf-5.10.0-266.0.0.168.oe2203sp3.x86_64.rpm",
        "perf-debuginfo-5.10.0-266.0.0.168.oe2203sp3.x86_64.rpm",
        "python3-perf-5.10.0-266.0.0.168.oe2203sp3.x86_64.rpm",
        "python3-perf-debuginfo-5.10.0-266.0.0.168.oe2203sp3.x86_64.rpm"
    ],
    "src": [
        "kernel-5.10.0-266.0.0.168.oe2203sp3.src.rpm"
    ]
}