[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAeHK+yshaEMc0oR-jCFR-m_9dSOFK8U7v_8EUa-0M1W5qFxuA@mail.gmail.com>
Date: Fri, 23 Jun 2017 14:21:54 +0200
From: Andrey Konovalov <andreyknvl@...gle.com>
To: Cong Wang <xiyou.wangcong@...il.com>
Cc: netdev <netdev@...r.kernel.org>
Subject: Re: [Patch net] sit: use __GFP_NOWARN for user controlled allocation
On Fri, Jun 23, 2017 at 12:29 AM, Cong Wang <xiyou.wangcong@...il.com> wrote:
> 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.
Thanks!
Tested-by: Andrey Konovalov <andreyknvl.com>
>
> Reported-by: Andrey Konovalov <andreyknvl@...gle.com>
> Cc: Andrey Konovalov <andreyknvl@...gle.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@...il.com>
> ---
> net/ipv6/sit.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
> index 2378503..f8ad158 100644
> --- a/net/ipv6/sit.c
> +++ b/net/ipv6/sit.c
> @@ -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();
> --
> 2.5.5
>
Powered by blists - more mailing lists