mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-23 09:56:00 +00:00
sit: use __GFP_NOWARN for user controlled allocation
The memory allocation size is controlled by user-space, if it is too large just fail silently and return NULL, not to mention there is a fallback allocation later. Reported-by: Andrey Konovalov <andreyknvl@google.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Tested-by: Andrey Konovalov <andreyknvl@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
a5cb659bbc
commit
0ccc22f425
@ -305,7 +305,7 @@ static int ipip6_tunnel_get_prl(struct ip_tunnel *t,
|
||||
* we try harder to allocate.
|
||||
*/
|
||||
kp = (cmax <= 1 || capable(CAP_NET_ADMIN)) ?
|
||||
kcalloc(cmax, sizeof(*kp), GFP_KERNEL) :
|
||||
kcalloc(cmax, sizeof(*kp), GFP_KERNEL | __GFP_NOWARN) :
|
||||
NULL;
|
||||
|
||||
rcu_read_lock();
|
||||
|
Loading…
Reference in New Issue
Block a user