Repository navigation
Commit 478de33
block, bfq: deschedule empty bfq_queues not referred by any process
Since commit 3726112 ("block, bfq: re-schedule empty queues if
they deserve I/O plugging"), to prevent the service guarantees of a
bfq_queue from being violated, the bfq_queue may be left busy, i.e.,
scheduled for service, even if empty (see comments in
__bfq_bfqq_expire() for details). But, if no process will send
requests to the bfq_queue any longer, then there is no point in
keeping the bfq_queue scheduled for service.
In addition, keeping the bfq_queue scheduled for service, but with no
process reference any longer, may cause the bfq_queue to be freed when
descheduled from service. But this is assumed to never happen, and
causes a UAF if it happens. This, in turn, caused crashes [1, 2].
This commit fixes this issue by descheduling an empty bfq_queue when
it remains with not process reference.
[1] https://bugzilla.redhat.com/show_bug.cgi?id=1767539
[2] https://bugzilla.kernel.org/show_bug.cgi?id=205447
Fixes: 3726112 ("block, bfq: re-schedule empty queues if they deserve I/O plugging")
Reported-by: Chris Evich <cevich@redhat.com>
Reported-by: Patrick Dung <patdung100@gmail.com>
Reported-by: Thorsten Schubert <tschubert@bafh.org>
Tested-by: Thorsten Schubert <tschubert@bafh.org>
Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name>
Signed-off-by: Paolo Valente <paolo.valente@linaro.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 5e55956 commit 478de33
1 file changed
Lines changed: 26 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2713 | 2713 | | |
2714 | 2714 | | |
2715 | 2715 | | |
| 2716 | + | |
| 2717 | + | |
| 2718 | + | |
| 2719 | + | |
| 2720 | + | |
| 2721 | + | |
| 2722 | + | |
| 2723 | + | |
| 2724 | + | |
| 2725 | + | |
| 2726 | + | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
| 2730 | + | |
| 2731 | + | |
| 2732 | + | |
| 2733 | + | |
| 2734 | + | |
| 2735 | + | |
| 2736 | + | |
| 2737 | + | |
2716 | 2738 | | |
2717 | 2739 | | |
2718 | 2740 | | |
| |||
2783 | 2805 | | |
2784 | 2806 | | |
2785 | 2807 | | |
2786 | | - | |
2787 | | - | |
| 2808 | + | |
2788 | 2809 | | |
2789 | 2810 | | |
2790 | 2811 | | |
| |||
4899 | 4920 | | |
4900 | 4921 | | |
4901 | 4922 | | |
4902 | | - | |
| 4923 | + | |
4903 | 4924 | | |
4904 | 4925 | | |
4905 | 4926 | | |
| |||
5001 | 5022 | | |
5002 | 5023 | | |
5003 | 5024 | | |
5004 | | - | |
5005 | | - | |
| 5025 | + | |
5006 | 5026 | | |
5007 | 5027 | | |
5008 | 5028 | | |
| |||
5963 | 5983 | | |
5964 | 5984 | | |
5965 | 5985 | | |
5966 | | - | |
| 5986 | + | |
5967 | 5987 | | |
5968 | 5988 | | |
5969 | 5989 | | |
| |||
0 commit comments