From: Ying Xue <ying.xue@windriver.com>
To: Eric Dumazet <edumazet@google.com>,
"David S . Miller" <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>,
Eric Dumazet <eric.dumazet@gmail.com>,
Jon Maloy <jon.maloy@ericsson.com>
Subject: Re: [PATCH net 2/2] tipc: fix possible crash in __tipc_nl_net_set()
Date: Tue, 17 Apr 2018 19:45:05 +0800 [thread overview]
Message-ID: <0232c2f1-024c-7f6c-f62d-4899a1fd4f14@windriver.com> (raw)
In-Reply-To: <20180416152943.103989-3-edumazet@google.com>
On 04/16/2018 11:29 PM, Eric Dumazet wrote:
> syzbot reported a crash in __tipc_nl_net_set() caused by NULL dereference.
>
> We need to check that both TIPC_NLA_NET_NODEID and TIPC_NLA_NET_NODEID_W1
> are present.
>
> We also need to make sure userland provided u64 attributes.
>
> Fixes: d50ccc2d3909 ("tipc: add 128-bit node identifier")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Jon Maloy <jon.maloy@ericsson.com>
> Cc: Ying Xue <ying.xue@windriver.com>
> Reported-by: syzbot <syzkaller@googlegroups.com>
Acked-by: Ying Xue <ying.xue@windriver.com>
> ---
> net/tipc/net.c | 2 ++
> net/tipc/netlink.c | 2 ++
> 2 files changed, 4 insertions(+)
>
> diff --git a/net/tipc/net.c b/net/tipc/net.c
> index 856f9e97ea293210bea1d2003d2092482732ace9..4fbaa0464405370601cb2fd1dd3b03733836d342 100644
> --- a/net/tipc/net.c
> +++ b/net/tipc/net.c
> @@ -252,6 +252,8 @@ int __tipc_nl_net_set(struct sk_buff *skb, struct genl_info *info)
> u64 *w0 = (u64 *)&node_id[0];
> u64 *w1 = (u64 *)&node_id[8];
>
> + if (!attrs[TIPC_NLA_NET_NODEID_W1])
> + return -EINVAL;
> *w0 = nla_get_u64(attrs[TIPC_NLA_NET_NODEID]);
> *w1 = nla_get_u64(attrs[TIPC_NLA_NET_NODEID_W1]);
> tipc_net_init(net, node_id, 0);
> diff --git a/net/tipc/netlink.c b/net/tipc/netlink.c
> index d4e0bbeee72793a060befaf8a9d0239731c0d48c..6ff2254088f647d4f7410c3335ccdae2e68ec522 100644
> --- a/net/tipc/netlink.c
> +++ b/net/tipc/netlink.c
> @@ -81,6 +81,8 @@ const struct nla_policy tipc_nl_net_policy[TIPC_NLA_NET_MAX + 1] = {
> [TIPC_NLA_NET_UNSPEC] = { .type = NLA_UNSPEC },
> [TIPC_NLA_NET_ID] = { .type = NLA_U32 },
> [TIPC_NLA_NET_ADDR] = { .type = NLA_U32 },
> + [TIPC_NLA_NET_NODEID] = { .type = NLA_U64 },
> + [TIPC_NLA_NET_NODEID_W1] = { .type = NLA_U64 },
> };
>
> const struct nla_policy tipc_nl_link_policy[TIPC_NLA_LINK_MAX + 1] = {
>
next prev parent reply other threads:[~2018-04-17 12:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-16 15:29 [PATCH net 0/2] tipc: Better check user provided attributes Eric Dumazet
2018-04-16 15:29 ` [PATCH net 1/2] tipc: add policy for TIPC_NLA_NET_ADDR Eric Dumazet
2018-04-17 11:33 ` Ying Xue
2018-04-16 15:29 ` [PATCH net 2/2] tipc: fix possible crash in __tipc_nl_net_set() Eric Dumazet
2018-04-17 11:45 ` Ying Xue [this message]
2018-04-16 19:21 ` [PATCH net 0/2] tipc: Better check user provided attributes Jon Maloy
2018-04-16 22:13 ` 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=0232c2f1-024c-7f6c-f62d-4899a1fd4f14@windriver.com \
--to=ying.xue@windriver.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=jon.maloy@ericsson.com \
--cc=netdev@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).