diff options
| author | Mikulas Patocka <mpatocka@redhat.com> | 2026-10-12 16:09:52 +0200 |
|---|---|---|
| committer | Mikulas Patocka <mpatocka@redhat.com> | 2026-10-13 15:35:43 +0200 |
| commit | 005d2ec5723cd4ac740de678274623f1fadd6a6e (patch) | |
| tree | 621359dbb861685b067803ebbb5947dbee5c87b6 /tools/lib/python/kdoc/python_version.py | |
| parent | 1190dbeaeaa026a4879e675b8556a150c36a7ced (diff) | |
dm-bufio: fix a race leading to an unsigned integer underflow
The function __scan tests "count - freed <= retain_target" and then sets
"atomic_long_set(&c->need_shrink, 0);" It exits with the condition "if
(!atomic_long_read(&c->need_shrink)) break;" It may be possible that
between these two statements, another thread sets &c->need_shrink to a
non-zero value. In this case, the function __scan continues and it may
possibly the "freed" variable is larger than the "count" variable. The
expression "count - freed" underflows and the function __scan will
continue to free all the buffers, even those that are below
retain_target.
Fix this bug by immediatelly exiting if we set
"atomic_long_set(&c->need_shrink, 0)"; and don't attempt to re-read
c->need_shrink afterwards.
Fixes: 450e8dee51aa ("dm bufio: improve concurrent IO performance")
Cc: stable@vger.kernel.org
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Assisted-by: Claude:claude-opus-5
Diffstat (limited to 'tools/lib/python/kdoc/python_version.py')
0 files changed, 0 insertions, 0 deletions
