Commit ea3aea7a authored by Pavel Skripkin's avatar Pavel Skripkin Committed by Yang Yingliang
Browse files

net: cipso: fix warnings in netlbl_cipsov4_add_std



mainline inclusion
from mainline-v5.15-rc1
commit 8ca34a13
category: bugfix
bugzilla: 186065
CVE: NA

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

Syzbot reported warning in netlbl_cipsov4_add(). The
problem was in too big doi_def->map.std->lvl.local_size
passed to kcalloc(). Since this value comes from userpace there is
no need to warn if value is not correct.

The same problem may occur with other kcalloc() calls in
this function, so, I've added __GFP_NOWARN flag to all
kcalloc() calls there.

Reported-and-tested-by: default avatar <syzbot+cdd51ee2e6b0b2e18c0d@syzkaller.appspotmail.com>
Fixes: 96cb8e33 ("[NetLabel]: CIPSOv4 and Unlabeled packet integration")
Acked-by: default avatarPaul Moore <paul@paul-moore.com>
Signed-off-by: default avatarPavel Skripkin <paskripkin@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarZhang Changzhong <zhangchangzhong@huawei.com>
Reviewed-by: default avatarYue Haibing <yuehaibing@huawei.com>
Reviewed-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent fd784d12
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment