Commit 7f430879 authored by Jamie Hill-Daniel's avatar Jamie Hill-Daniel Committed by Zheng Zengkai
Browse files

vfs: fs_context: fix up param length parsing in legacy_parse_param

mainline inclusion
from mainline-v5.17-rc1
commit 722d9484
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I4YD3S


CVE: CVE-2022-0185

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

The "PAGE_SIZE - 2 - size" calculation in legacy_parse_param() is an
unsigned type so a large value of "size" results in a high positive
value instead of a negative value as expected.  Fix this by getting rid
of the subtraction.

Signed-off-by: default avatarJamie Hill-Daniel <jamie@hill-daniel.co.uk>
Signed-off-by: default avatarWilliam Liu <willsroot@protonmail.com>
Tested-by: default avatarSalvatore Bonaccorso <carnil@debian.org>
Tested-by: default avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Acked-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarLuo Meng <luomeng12@huawei.com>
Reviewed-by: default avatarZhang Yi <yi.zhang@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent cbe05603
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment