diff options
| author | Yanfei Xu <[email protected]> | 2021-06-28 19:35:01 -0700 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2021-06-29 10:53:47 -0700 |
| commit | 54dd200c5a251b5db9f6f0f72a251c28e0d7da43 (patch) | |
| tree | 898026c6323e8fad852160d8944f15097f2ef38e /tools/perf/scripts/python | |
| parent | 65ebdeef103fd70988fdd0ffef1d4fecb0cb97ed (diff) | |
mm/kmemleak: fix possible wrong memory scanning period
This commit contains 3 modifications:
1. Convert the type of jiffies_scan_wait to "unsigned long".
2. Use READ/WRITE_ONCE() for accessing "jiffies_scan_wait".
3. Fix the possible wrong memory scanning period. If you set a large
memory scanning period like blow, then the "secs" variable will be
non-zero, however the value of "jiffies_scan_wait" will be zero.
echo "scan=0x10000000" > /sys/kernel/debug/kmemleak
It is because the type of the msecs_to_jiffies()'s parameter is "unsigned
int", and the "secs * 1000" is larger than its max value. This in turn
leads a unexpected jiffies_scan_wait, maybe zero. We corret it by
replacing kstrtoul() with kstrtouint(), and check the msecs to prevent it
larger than UINT_MAX.
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Yanfei Xu <[email protected]>
Acked-by: Catalin Marinas <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions