diff options
author | Phil Auld <[email protected]> | 2022-09-06 16:35:42 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2022-09-22 13:13:12 +0200 |
commit | d7f06bdd6ee87fbefa05af5f57361d85e7715b11 (patch) | |
tree | d595e26a9ee2d6f4256f5aba00bbe912a1cec8b4 /drivers/net/wwan/iosm/iosm_ipc_pm.c | |
parent | d8ab4685adc1f78aef5ece1334a47ca1a8181745 (diff) |
drivers/base: Fix unsigned comparison to -1 in CPUMAP_FILE_MAX_BYTES
As PAGE_SIZE is unsigned long, -1 > PAGE_SIZE when NR_CPUS <= 3.
This leads to very large file sizes:
topology$ ls -l
total 0
-r--r--r-- 1 root root 18446744073709551615 Sep 5 11:59 core_cpus
-r--r--r-- 1 root root 4096 Sep 5 11:59 core_cpus_list
-r--r--r-- 1 root root 4096 Sep 5 10:58 core_id
-r--r--r-- 1 root root 18446744073709551615 Sep 5 10:10 core_siblings
-r--r--r-- 1 root root 4096 Sep 5 11:59 core_siblings_list
-r--r--r-- 1 root root 18446744073709551615 Sep 5 11:59 die_cpus
-r--r--r-- 1 root root 4096 Sep 5 11:59 die_cpus_list
-r--r--r-- 1 root root 4096 Sep 5 11:59 die_id
-r--r--r-- 1 root root 18446744073709551615 Sep 5 11:59 package_cpus
-r--r--r-- 1 root root 4096 Sep 5 11:59 package_cpus_list
-r--r--r-- 1 root root 4096 Sep 5 10:58 physical_package_id
-r--r--r-- 1 root root 18446744073709551615 Sep 5 10:10 thread_siblings
-r--r--r-- 1 root root 4096 Sep 5 11:59 thread_siblings_list
Adjust the inequality to catch the case when NR_CPUS is configured
to a small value.
Fixes: 7ee951acd31a ("drivers/base: fix userspace break from using bin_attributes for cpumap and cpulist")
Cc: Greg Kroah-Hartman <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Cc: Yury Norov <[email protected]>
Cc: [email protected]
Cc: feng xiangjun <[email protected]>
Reported-by: feng xiangjun <[email protected]>
Signed-off-by: Phil Auld <[email protected]>
Signed-off-by: Yury Norov <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'drivers/net/wwan/iosm/iosm_ipc_pm.c')
0 files changed, 0 insertions, 0 deletions