anolis: mm: pagecache_limit: reject reclaim_interval_ms values above UINT_MAX
ANBZ: #54819
The memory.pagecache_limit.reclaim_interval_ms cgroup v1 interface parses its input with kstrtou64() but passes the value directly to msecs_to_jiffies(), whose parameter type is unsigned int. Values above UINT_MAX therefore lose their high bits silently: writing 4294967296 (2^32) succeeds and stores/reads back 0, which disables the reclaim worker’s interval-based re-arming in memcg_pgcache_limit_work_func(), and writing 2^32+1000 is treated as 1000 ms. The saturation guard inside __msecs_to_jiffies() only sees the already-narrowed value and cannot catch this.
Reject inputs above UINT_MAX with -EINVAL in the write callback, so over-range configurations fail loudly instead of silently changing the configured interval. All values within [0, UINT_MAX] keep their exact previous behavior.
Fixes: 0d2c9219090f (“anolis: mm: pagecache_limit: reclaim pagecache smoothly”) Signed-off-by: Yuanhe Shu xiangzao@linux.alibaba.com Reviewed-by: Baolin Wang baolin.wang@linux.alibaba.com Link: https://gitee.com/anolis/cloud-kernel/pulls/16454
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
Linux kernel
There are several guides for kernel developers and users. These guides can be rendered in a number of formats, like HTML and PDF. Please read Documentation/admin-guide/README.rst first.
In order to build the documentation, use
make htmldocsormake pdfdocs. The formatted documentation can also be read online at:There are various text files in the Documentation/ subdirectory, several of them using the Restructured Text markup notation.
Please read the Documentation/process/changes.rst file, as it contains the requirements for building and running the kernel, and information about the problems which may result by upgrading your kernel.