Skip to content
Commit 43f532f1 authored by Roman Smirnov's avatar Roman Smirnov Committed by Li Nan
Browse files

block: prevent division by zero in blk_rq_stat_sum()

stable inclusion
from stable-v4.19.312
commit 6a55dab4ac956deb23690eedd74e70b892a378e7
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9QGM9
CVE: CVE-2024-35925

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=6a55dab4ac956deb23690eedd74e70b892a378e7



--------------------------------

[ Upstream commit 93f52fbeaf4b676b21acfe42a5152620e6770d02 ]

The expression dst->nr_samples + src->nr_samples may
have zero value on overflow. It is necessary to add
a check to avoid division by zero.

Found by Linux Verification Center (linuxtesting.org) with Svace.

Signed-off-by: default avatarRoman Smirnov <r.smirnov@omp.ru>
Reviewed-by: default avatarSergey Shtylyov <s.shtylyov@omp.ru>
Link: https://lore.kernel.org/r/20240305134509.23108-1-r.smirnov@omp.ru


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarLi Nan <linan122@huawei.com>
parent 4ba26291
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment