hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/ICAOAT ----------------------------------------- IFS subsystem disables itself in cgroup_ifs_tsc_init() when TSC is not detected, skipping the initialization of cgroup_ifs_files. However, ifs_enable may remain true in this case, leading to a subsequent call to cgroup_ifs_add_files that uses the uninitialized cgroup_ifs_files and causes a null pointer dereference. Fix this by explicitly setting ifs_enable to false when IFS is disabled. Fixes: 9c735dcd118d ("interference: Use hardware timer counter") Signed-off-by: Tengda Wu <wutengda2@huawei.com> --- kernel/cgroup/ifs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/cgroup/ifs.c b/kernel/cgroup/ifs.c index e6419899d725..8106e91f1e92 100644 --- a/kernel/cgroup/ifs.c +++ b/kernel/cgroup/ifs.c @@ -340,6 +340,7 @@ static int cgroup_ifs_tsc_init(void) #endif if (!freq) { pr_warn("Disable CGROUP IFS: no constant tsc\n"); + ifs_enable = false; return -1; } -- 2.34.1