flex_proportions: make fprop_new_period() hardirq safe
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
flex_proportions: make fprop_new_period() hardirq safe
Bernd has reported a lockdep splat from flexible proportions code that is essentially complaining about the following race:
<timer fires> run_timer_softirq - we are in softirq context call_timer_fn writeout_period fprop_new_period write_seqcount_begin(&p->sequence);
<hardirq is raised> ... blk_mq_end_request() blk_update_request() ext4_end_bio() folio_end_writeback() __wb_writeout_add() __fprop_add_percpu_max() if (unlikely(max_frac < FPROP_FRAC_BASE)) { fprop_fraction_percpu() seq = read_seqcount_begin(&p->sequence); - sees odd sequence so loops indefinitely
Note that a deadlock like this is only possible if the bdi has configured maximum fraction of writeout throughput which is very rare in general but frequent for example for FUSE bdis. To fix this problem we have to make sure write section of the sequence counter is irqsafe.
From the CVE record · Linux
The Linux kernel’s flexible proportions code can deadlock when a hard interrupt interrupts a timer callback updating a sequence counter. This requires a backing device configured with a maximum fraction of writeout throughput, a setting described as rare generally but frequent for FUSE backing devices. The input does not establish whether an attacker can trigger the condition or whether authentication or user interaction is required.
Engineers running the Linux kernel, particularly with FUSE backing devices or a configured maximum writeout fraction, should check their deployments; affected versions were not provided.