CVE-2024-50270

mm/damon/core: avoid overflow in damon_feed_loop_next_input()

Medium · published November 19, 2024

CVSS v3.1
5.5
EPSS
0%
Percentile
9.2
In the wild
Unconfirmed
What it is

In the Linux kernel, the following vulnerability has been resolved:

mm/damon/core: avoid overflow in damon_feed_loop_next_input()

damon_feed_loop_next_input() is inefficient and fragile to overflows.

Specifically, 'score_goal_diff_bp' calculation can overflow when 'score'

is high. The calculation is actually unnecessary at all because 'goal' is

a constant of value 10,000. Calculation of 'compensation' is again

fragile to overflow. Final calculation of return value for under-achiving

case is again fragile to overflow when the current score is

under-achieving the target.

Add two corner cases handling at the beginning of the function to make the

body easier to read, and rewrite the body of the function to avoid

overflows and the unnecessary bp value calcuation.

The record
Technical detail
CVSS v3.1
5.5 · MEDIUM
Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
CVSS v4.0
Not supplied
EPSS
0.00199 · 9.2th percentile
Published
2024-11-19T01:30Z
EPSS history
Timeline
  • 19 NOV 01:30Z
    mm/damon/core: avoid overflow in damon_feed_loop_next_input()
    cvelistv5