]> git.baikalelectronics.ru Git - kernel.git/commit
net: cipso: fix warnings in netlbl_cipsov4_add_std
authorPavel Skripkin <paskripkin@gmail.com>
Tue, 27 Jul 2021 16:35:30 +0000 (19:35 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 27 Jul 2021 19:58:30 +0000 (20:58 +0100)
commite97add5399019ea297b2fe8be65e02aea85ed3ba
tree910fea2d2e63460ec1301fd4b5058d6c354b5901
parentda7012f8f97aeca3863088b843883dbbc8d5b572
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: 069281934f93 ("[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>
net/netlabel/netlabel_cipso_v4.c