From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Baozeng Ding <sploving1@gmail.com>,
davem@davemloft.net, herbert@gondor.apana.org.au,
daniel@iogearbox.net, tgraf@suug.ch, pablo@netfilter.org,
chamaken@gmail.com, nicolas.dichtel@6wind.com, fw@strlen.de
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] netlink: fix null pointer dereference on nlk->groups
Date: Fri, 8 Jan 2016 22:43:22 +0300 [thread overview]
Message-ID: <5690115A.4070405@cogentembedded.com> (raw)
In-Reply-To: <1452231970-27357-1-git-send-email-sploving1@gmail.com>
Hello.
On 01/08/2016 08:46 AM, Baozeng Ding wrote:
> If groups is not 0 and nlk->groups is NULL, it will not return
> immediately and cause a null pointer dereference later.
>
> Signed-off-by: Baozeng Ding <sploving1@gmail.com>
> ---
> net/netlink/af_netlink.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
> index 59651af..38efde0 100644
> --- a/net/netlink/af_netlink.c
> +++ b/net/netlink/af_netlink.c
[...]
> @@ -1576,14 +1577,17 @@ static int netlink_bind(struct socket *sock, struct sockaddr *addr,
> }
> }
>
> - if (!groups && (nlk->groups == NULL || !(u32)nlk->groups[0]))
> + if (nlk->groups == NULL)
'!nlk->groups' is preferred in the networking code.
[...]
MBR, Sergei
next prev parent reply other threads:[~2016-01-08 19:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-08 5:46 [PATCH] netlink: fix null pointer dereference on nlk->groups Baozeng Ding
2016-01-08 19:43 ` Sergei Shtylyov [this message]
2016-01-09 15:56 ` [PATCH v2] " Baozeng Ding
2016-01-11 4:27 ` David Miller
2016-01-12 11:10 ` [PATCH v3] " Baozeng Ding
2016-01-12 11:15 ` Denis Kirjanov
2016-01-12 12:00 ` Herbert Xu
2016-01-12 19:40 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5690115A.4070405@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=chamaken@gmail.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=fw@strlen.de \
--cc=herbert@gondor.apana.org.au \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--cc=pablo@netfilter.org \
--cc=sploving1@gmail.com \
--cc=tgraf@suug.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.