提交 6f688ce9 编写于 作者: L Liu Shixin 提交者: Zheng Zengkai

kfence: parse param before alloc kfence_pool

hulk inclusion
category: bugfix
bugzilla: 186414, https://gitee.com/openeuler/kernel/issues/I53YXV
CVE: NA

--------------------------------

Patch 1919867e8bad advanced the allocation of kfence_pool to setup_arch().
Since the macro module_param_cb is parsed after setup_arch(), it's invalid
to set sample_interval and num_objects in cmdline. Add macro early_param
to parse the cmdline to make it effective before the allocation of
kfence_pool.

Fixes: 1919867e8bad ("arm64: remove page granularity limitation from KFENCE")
Conflicts:
	mm/kfence/core.c
Signed-off-by: NLiu Shixin <liushixin2@huawei.com>
Reviewed-by: NKefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 a6fd32d9
......@@ -85,6 +85,19 @@ static const struct kernel_param_ops sample_interval_param_ops = {
};
module_param_cb(sample_interval, &sample_interval_param_ops, &kfence_sample_interval, 0600);
#ifdef CONFIG_ARM64
static int __init parse_sample_interval(char *str)
{
unsigned long num;
if (kstrtoul(str, 0, &num) < 0)
return 0;
kfence_sample_interval = num;
return 0;
}
early_param("kfence.sample_interval", parse_sample_interval);
#endif
/* Pool usage% threshold when currently covered allocations are skipped. */
static unsigned long kfence_skip_covered_thresh __read_mostly = 75;
module_param_named(skip_covered_thresh, kfence_skip_covered_thresh, ulong, 0644);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册