lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251030143221.46859-1-sj@kernel.org>
Date: Thu, 30 Oct 2025 07:32:20 -0700
From: SeongJae Park <sj@...nel.org>
To: Quanmin Yan <yanquanmin1@...wei.com>
Cc: SeongJae Park <sj@...nel.org>,
	akpm@...ux-foundation.org,
	damon@...ts.linux.dev,
	linux-kernel@...r.kernel.org,
	linux-mm@...ck.org,
	wangkefeng.wang@...wei.com,
	zuoze1@...wei.com
Subject: Re: [PATCH v2 2/2] mm/damon/sysfs: change next_update_jiffies to a global variable

On Thu, 30 Oct 2025 10:07:46 +0800 Quanmin Yan <yanquanmin1@...wei.com> wrote:

> In DAMON’s damon_sysfs_repeat_call_fn(), time_before() is used to compare
> the current jiffies with next_update_jiffies to determine whether to
> update the sysfs files at this moment.
> 
> On 32-bit systems, the kernel initializes jiffies to "-5 minutes" to make
> jiffies wrap bugs appear earlier. However, this causes time_before() in
> damon_sysfs_repeat_call_fn() to unexpectedly return true during the first
> 5 minutes after boot on 32-bit systems (see [1] for more explanation,
> which fixes another jiffies-related issue before). As a result, DAMON
> does not update sysfs files during that period.
> 
> There is also an issue unrelated to the system’s word size[2]: if the
> user stops DAMON just after next_update_jiffies is updated and restarts
> it after 'refresh_ms' or a longer delay, next_update_jiffies will retain
> an older value, causing time_before() to return false and the update to
> happen earlier than expected.
> 
> Fix these issues by making next_update_jiffies a global variable and
> initializing it each time DAMON is started.
> 
> [1] https://lkml.kernel.org/r/20250822025057.1740854-1-ekffu200098@gmail.com
> [2] https://lore.kernel.org/all/20251029013038.66625-1-sj@kernel.org/

Thank you for finding and fixing these!

> 
> Fixes: d809a7c64ba8 ("mm/damon/sysfs: implement refresh_ms file internal work")
> Suggested-by: SeongJae Park <sj@...nel.org>
> Signed-off-by: Quanmin Yan <yanquanmin1@...wei.com>

Reviewed-by: SeongJae Park <sj@...nel.org>


Thanks,
SJ

[...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ