Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

clk: qcom: clk-rpmh: prevent integer overflow in recalc_rate

aggr_state and unit fields are u32. The result of their
multiplication may not fit in this type.

Add explicit casting to prevent overflow.

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

Fixes: 04053f4d23a4 ("clk: qcom: clk-rpmh: Add IPA clock support")
Cc: stable@vger.kernel.org # 5.4+
Signed-off-by: Anastasia Belova <abelova@astralinux.ru>
Link: https://lore.kernel.org/r/20241203084231.6001-1-abelova@astralinux.ru
Signed-off-by: Bjorn Andersson <andersson@kernel.org>

authored by

Anastasia Belova and committed by
Bjorn Andersson
89aa5925 39d6dcf6

+1 -1
+1 -1
drivers/clk/qcom/clk-rpmh.c
··· 329 329 { 330 330 struct clk_rpmh *c = to_clk_rpmh(hw); 331 331 332 - return c->aggr_state * c->unit; 332 + return (unsigned long)c->aggr_state * c->unit; 333 333 } 334 334 335 335 static const struct clk_ops clk_rpmh_bcm_ops = {