diff options
author | Liu Yuntao <[email protected]> | 2022-02-25 19:11:02 -0800 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2022-02-26 09:51:17 -0800 |
commit | e79ce9832316e09529b212a21278d68240ccbf1f (patch) | |
tree | 6636ff389bbec8db1d3655f029febabe8893ee9a /lib/test-string_helpers.c | |
parent | 70effdc3756c924f4a2b6af1ec4e2e92e18e1b45 (diff) |
hugetlbfs: fix a truncation issue in hugepages parameter
When we specify a large number for node in hugepages parameter, it may
be parsed to another number due to truncation in this statement:
node = tmp;
For example, add following parameter in command line:
hugepagesz=1G hugepages=4294967297:5
and kernel will allocate 5 hugepages for node 1 instead of ignoring it.
I move the validation check earlier to fix this issue, and slightly
simplifies the condition here.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: b5389086ad7be0 ("hugetlbfs: extend the definition of hugepages parameter to support node allocation")
Signed-off-by: Liu Yuntao <[email protected]>
Reviewed-by: Mike Kravetz <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/test-string_helpers.c')
0 files changed, 0 insertions, 0 deletions