Files
Centos-kernel-stream-9/drivers
CKI KWF Bot 1e60cab914 Merge: dm cache policy smq: check allocation under invalidate lock
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/8665

JIRA: https://issues.redhat.com/browse/RHEL-231826
CVE: CVE-2026-53062
Tested: Reproducer and dm cache tests
Upstream Status: kernel/git/torvalds/linux.git

commit d3f0a606b9f278ece8a0df626ded9c4044071235
Author: Guangshuo Li <lgs201920130244@gmail.com>
Date:   Fri May 29 23:57:45 2026 +0800

    dm cache policy smq: check allocation under invalidate lock

    commit 2d1f7b65f5de ("dm cache policy smq: fix missing locks in
    invalidating cache blocks") added mq->lock around the destructive part of
    smq_invalidate_mapping(), but left the e->allocated check outside the
    critical section.

    That leaves a check-then-act race. Two concurrent invalidators can both
    observe e->allocated as true before either of them takes mq->lock. The
    first invalidator that acquires the lock removes the entry from the
    queues and hash table and then calls free_entry(), which clears
    e->allocated and puts the entry back on the free list. The second
    invalidator can then acquire mq->lock and continue with the stale result
    of the unlocked check.

    This can corrupt the SMQ queues or hash table by deleting an entry that
    is no longer on those structures. It can also hit the allocation check in
    free_entry() when the same entry is freed again.

    Move the allocation check under mq->lock so the predicate and the
    destructive operations are serialized by the same lock.

    Fixes: 2d1f7b65f5de ("dm cache policy smq: fix missing locks in invalidating cache blocks")
    Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
    Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>

Approved-by: Matthew Sakai <msakai@redhat.com>
Approved-by: Ming Hung Tsai <mtsai@redhat.com>
Approved-by: Kenneth Raeburn <raeburn@redhat.com>
Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com>

Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2026-08-21 17:22:22 +00:00
..
2026-06-15 08:10:05 +00:00
2026-06-30 13:47:36 -04:00
2026-06-25 12:42:23 +01:00