Skip to content

net: cipso: fix warnings in netlbl_cipsov4_add_std

Guillaume Nault requested to merge gnault/centos-stream-9:bz2079246 into main

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2079246 Upstream Status: linux.git

commit 8ca34a13f7f9b3fa2c464160ffe8cc1a72088204 Author: Pavel Skripkin paskripkin@gmail.com Date: Tue Jul 27 19:35:30 2021 +0300

net: cipso: fix warnings in netlbl_cipsov4_add_std

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: syzbot+cdd51ee2e6b0b2e18c0d@syzkaller.appspotmail.com
Fixes: 96cb8e3313c7 ("[NetLabel]: CIPSOv4 and Unlabeled packet integration")
Acked-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Guillaume Nault gnault@redhat.com

Merge request reports