# CVE-2021-47493: ocfs2: fix race between searching chunks and release journal_head from buffer_head

- Severity: High 7.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.17%, higher than 7% of CVEs (2026-12-01)
- Published: 2024-05-22T08:19:41.419Z
- Modified: 2026-08-05T08:48:03.801Z
- Weaknesses: CWE-362
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

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

ocfs2: fix race between searching chunks and release journal_head from buffer_head

Encountered a race between ocfs2_test_bg_bit_allocatable() and
jbd2_journal_put_journal_head() resulting in the below vmcore.

  PID: 106879  TASK: ffff880244ba9c00  CPU: 2   COMMAND: "loop3"
  Call trace:
    panic
    oops_end
    no_context
    __bad_area_nosemaphore
    bad_area_nosemaphore
    __do_page_fault
    do_page_fault
    page_fault
      [exception RIP: ocfs2_block_group_find_clear_bits+316]
    ocfs2_block_group_find_clear_bits [ocfs2]
    ocfs2_cluster_group_search [ocfs2]
    ocfs2_search_chain [ocfs2]
    ocfs2_claim_suballoc_bits [ocfs2]
    __ocfs2_claim_clusters [ocfs2]
    ocfs2_claim_clusters [ocfs2]
    ocfs2_local_alloc_slide_window [ocfs2]
    ocfs2_reserve_local_alloc_bits [ocfs2]
    ocfs2_reserve_clusters_with_limit [ocfs2]
    ocfs2_reserve_clusters [ocfs2]
    ocfs2_lock_refcount_allocators [ocfs2]
    ocfs2_make_clusters_writable [ocfs2]
    ocfs2_replace_cow [ocfs2]
    ocfs2_refcount_cow [ocfs2]
    ocfs2_file_write_iter [ocfs2]
    lo_rw_aio
    loop_queue_work
    kthread_worker_fn
    kthread
    ret_from_fork

When ocfs2_test_bg_bit_allocatable() called bh2jh(bg_bh), the
bg_bh->b_private NULL as jbd2_journal_put_journal_head() raced and
released the jounal head from the buffer head.  Needed to take bit lock
for the bit 'BH_JournalHead' to fix this race.

(As written by CVE List.)

## Affected

- Linux Linux: from ccd979bdbce9fba8412beb3f1de68a9d0171b12c before 5043fbd294f5909a080ade0f04b70a4da9e122b7; from ccd979bdbce9fba8412beb3f1de68a9d0171b12c before 2e382600e8856ea654677b5134ee66e03ea72bc2; from ccd979bdbce9fba8412beb3f1de68a9d0171b12c before 6f1b228529ae49b0f85ab89bcdb6c365df401558; 2.6.16 (not affected: before 2.6.16; from 5.10.77 up to 5.10.*; from 5.14.16 up to 5.14.*; from 5.15 up to *)
- linux linux_kernel: before 5.10.77; from 5.11 before 5.14.16; 5.15

## Every score

- Linux: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 4.7 Medium `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://git.kernel.org/stable/c/5043fbd294f5909a080ade0f04b70a4da9e122b7> (patch)
- <https://git.kernel.org/stable/c/2e382600e8856ea654677b5134ee66e03ea72bc2> (patch)
- <https://git.kernel.org/stable/c/6f1b228529ae49b0f85ab89bcdb6c365df401558> (patch)

## Sources

- CVE List: [CVE-2021-47493](https://www.cve.org/CVERecord?id=CVE-2021-47493), CVE Terms of Use, modified 2026-08-05
- NVD: [CVE-2021-47493](https://nvd.nist.gov/vuln/detail/CVE-2021-47493), Public domain, modified 2026-08-04

---

Page: https://cve.day/CVE-2021-47493 · Whole record: https://cve.day/CVE-2021-47493.json · Rebuilt by cve.day 2026-11-25T22:58:08.883Z
