Bug 2295914 (CVE-2024-39476) - CVE-2024-39476 kernel: md/raid5: fix deadlock that raid5d() wait for itself to clear MD_SB_CHANGE_PENDING
Summary: CVE-2024-39476 kernel: md/raid5: fix deadlock that raid5d() wait for itself t...
Keywords:
Status: NEW
Alias: CVE-2024-39476
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-07-05 09:21 UTC by OSIDB Bzimport
Modified: 2024-09-04 08:15 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2024:5117 0 None None None 2024-08-08 08:35:47 UTC
Red Hat Product Errata RHBA-2024:5207 0 None None None 2024-08-12 07:54:52 UTC
Red Hat Product Errata RHBA-2024:5208 0 None None None 2024-08-12 08:34:16 UTC
Red Hat Product Errata RHBA-2024:5233 0 None None None 2024-08-12 13:53:36 UTC
Red Hat Product Errata RHBA-2024:5235 0 None None None 2024-08-12 14:26:21 UTC
Red Hat Product Errata RHBA-2024:5236 0 None None None 2024-08-12 14:42:31 UTC
Red Hat Product Errata RHBA-2024:5237 0 None None None 2024-08-12 14:45:50 UTC
Red Hat Product Errata RHBA-2024:5386 0 None None None 2024-08-14 10:50:11 UTC
Red Hat Product Errata RHBA-2024:5866 0 None None None 2024-08-26 14:40:54 UTC
Red Hat Product Errata RHBA-2024:6299 0 None None None 2024-09-04 08:15:10 UTC
Red Hat Product Errata RHSA-2024:5101 0 None None None 2024-08-08 04:58:07 UTC
Red Hat Product Errata RHSA-2024:5102 0 None None None 2024-08-08 04:46:26 UTC
Red Hat Product Errata RHSA-2024:5928 0 None None None 2024-08-28 12:20:57 UTC

Description OSIDB Bzimport 2024-07-05 09:21:30 UTC
In the Linux kernel, the following vulnerability has been resolved:

md/raid5: fix deadlock that raid5d() wait for itself to clear MD_SB_CHANGE_PENDING

Xiao reported that lvm2 test lvconvert-raid-takeover.sh can hang with
small possibility, the root cause is exactly the same as commit
bed9e27baf52 ("Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d"")

However, Dan reported another hang after that, and junxiao investigated
the problem and found out that this is caused by plugged bio can't issue
from raid5d().

Current implementation in raid5d() has a weird dependence:

1) md_check_recovery() from raid5d() must hold 'reconfig_mutex' to clear
   MD_SB_CHANGE_PENDING;
2) raid5d() handles IO in a deadloop, until all IO are issued;
3) IO from raid5d() must wait for MD_SB_CHANGE_PENDING to be cleared;

This behaviour is introduce before v2.6, and for consequence, if other
context hold 'reconfig_mutex', and md_check_recovery() can't update
super_block, then raid5d() will waste one cpu 100% by the deadloop, until
'reconfig_mutex' is released.

Refer to the implementation from raid1 and raid10, fix this problem by
skipping issue IO if MD_SB_CHANGE_PENDING is still set after
md_check_recovery(), daemon thread will be woken up when 'reconfig_mutex'
is released. Meanwhile, the hang problem will be fixed as well.

Comment 11 errata-xmlrpc 2024-08-08 04:46:25 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2024:5102 https://access.redhat.com/errata/RHSA-2024:5102

Comment 12 errata-xmlrpc 2024-08-08 04:58:06 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2024:5101 https://access.redhat.com/errata/RHSA-2024:5101

Comment 13 errata-xmlrpc 2024-08-28 12:20:56 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2024:5928 https://access.redhat.com/errata/RHSA-2024:5928


Note You need to log in before you can comment on or make changes to this bug.