提交 99b7756c 编写于 作者: Z Zhou Guanghui 提交者: Wang Wensheng

mm/sharepool: Check the maximum value of spg_id

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

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

The maximum value of spg_id is checked to ensure that the value
of spg_id is within the valid range:
SPG_ID_DEFAULT or [SPG_ID_MIN SPG_ID_AUTO)
Signed-off-by: NZhou Guanghui <zhouguanghui1@huawei.com>
上级 27d0e771
无相关合并请求
......@@ -2245,7 +2245,7 @@ static int sp_alloc_prepare(unsigned long size, unsigned long sp_flags,
return -EINVAL;
}
if (spg_id != SPG_ID_DEFAULT && spg_id < SPG_ID_MIN) {
if (spg_id != SPG_ID_DEFAULT && (spg_id < SPG_ID_MIN || spg_id >= SPG_ID_AUTO)) {
pr_err_ratelimited("allocation failed, invalid group id %d\n", spg_id);
return -EINVAL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部