[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160623101253.GA9665@salvia>
Date: Thu, 23 Jun 2016 12:12:53 +0200
From: Pablo Neira Ayuso <pablo@...filter.org>
To: Xiubo Li <lixiubo@...s.chinamobile.com>
Cc: kaber@...sh.net, kadlec@...ckhole.kfki.hu, davem@...emloft.net,
netfilter-devel@...r.kernel.org, netfilter@...r.kernel.org,
coreteam@...filter.org, netdev@...r.kernel.org
Subject: Re: [PATCH v2] netfilter: fix possible ZERO_SIZE_PTR pointer
dereferencing error.
On Thu, Jun 02, 2016 at 10:59:56AM +0800, Xiubo Li wrote:
> Since we cannot make sure that the 'hook_mask' will always be none
> zero here. If it equals to zero, the num_hooks will be zero too,
> and then kmalloc() will return ZERO_SIZE_PTR, which is (void *)16.
>
> Then the following error check will fails:
> ops = kmalloc(sizeof(*ops) * num_hooks, GFP_KERNEL);
> if (ops == NULL)
> return ERR_PTR(-ENOMEM);
>
> So this patch will fix this with just doing the zero check before
> kmalloc() is called.
>
> Maybe the case above will never happen here, but in theory.
Applied, thanks.
Powered by blists - more mailing lists