summaryrefslogtreecommitdiffstats
path: root/net/tipc/netlink.c
diff options
context:
space:
mode:
authorEric Dumazet2018-04-16 17:29:43 +0200
committerDavid S. Miller2018-04-17 00:08:18 +0200
commitc6404122cb18f1fbd2a6dc85ab687f6fa2e454cf (patch)
tree446adab675af1e507ab048a2efe35edd427fdd34 /net/tipc/netlink.c
parenttipc: add policy for TIPC_NLA_NET_ADDR (diff)
downloadkernel-qcow2-linux-c6404122cb18f1fbd2a6dc85ab687f6fa2e454cf.tar.gz
kernel-qcow2-linux-c6404122cb18f1fbd2a6dc85ab687f6fa2e454cf.tar.xz
kernel-qcow2-linux-c6404122cb18f1fbd2a6dc85ab687f6fa2e454cf.zip
tipc: fix possible crash in __tipc_nl_net_set()
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/netlink.c')
-rw-r--r--net/tipc/netlink.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/tipc/netlink.c b/net/tipc/netlink.c
index d4e0bbeee727..6ff2254088f6 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] = {