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] [thread-next>] [day] [month] [year] [list]
Message-ID: <c3050ee1-a3f6-4f3f-8cd3-a5d67dcdcacc@huawei.com>
Date: Tue, 19 Aug 2025 22:45:58 +0800
From: Quanmin Yan <yanquanmin1@...wei.com>
To: SeongJae Park <sj@...nel.org>
CC: <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: [RFC PATCH -next 07/16] mm/damon/sysfs: implement addr_unit file
 under context dir

Hi SJ,

在 2025/8/19 14:24, SeongJae Park 写道:
> Hi Quanmin,
>
> As I suggested on another reply[1], please squash attaching patch to this one
> when you post next version of this series.
>
> [1] https://lore.kernel.org/20250813170224.6128-1-sj@kernel.org
>
> [...]
>
>
> Thanks,
> SJ
>
> ==== Attachment 0 (0001-mm-damon-sysfs-return-EINVAL-for-zero-addr_unit.patch) ====
>  From e0a5aa5e571ecd0f58b0914f8fc8562a60014ae8 Mon Sep 17 00:00:00 2001
> From: SeongJae Park <sj@...nel.org>
> Date: Wed, 13 Aug 2025 21:17:03 -0700
> Subject: [PATCH] mm/damon/sysfs: return -EINVAL for zero addr_unit
>
> Signed-off-by: SeongJae Park <sj@...nel.org>
> ---
>   mm/damon/sysfs.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c
> index bea782b0a711..eb4269383bae 100644
> --- a/mm/damon/sysfs.c
> +++ b/mm/damon/sysfs.c
> @@ -1422,6 +1422,8 @@ static int damon_sysfs_apply_inputs(struct damon_ctx *ctx,
>   	err = damon_select_ops(ctx, sys_ctx->ops_id);
>   	if (err)
>   		return err;
> +	if (!sys_ctx->addr_unit)
> +		return -EINVAL;
>   	ctx->addr_unit = sys_ctx->addr_unit;
>   	err = damon_sysfs_set_attrs(ctx, sys_ctx->attrs);
>   	if (err)

Aha, returning -EINVAL when sys_ctx->addr_unit is 0 makes sense, but I wonder if it
might be better to prevent users from inputting 0 at the source instead? I've attempted
to modify patch 7 by adding a check in addr_unit_store. I'll send out the v2 version
of patch 7 later (PS: I am performing a comprehensive validation of the v2 patch series),
and we can discuss it then.

Thanks,
Quanmin Yan


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ