diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-27 15:22:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-27 15:22:57 -0400 |
commit | 1a9df9e29c2afecf6e3089442d429b377279ca3c (patch) | |
tree | 609a39b5f4a3f5bdeb7031aac765e503b6d9d759 /net/tipc | |
parent | 14c741de93861749dfb60b4964028541f5c506ca (diff) | |
parent | 8c838f53e149871561a9261ac768a9c7071b43d0 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller:
"Fixes here and there, a couple new device IDs, as usual:
1) Fix BQL race in dpaa2-eth driver, from Ioana Ciornei.
2) Fix 64-bit division in iwlwifi, from Arnd Bergmann.
3) Fix documentation for some eBPF helpers, from Quentin Monnet.
4) Some UAPI bpf header sync with tools, also from Quentin Monnet.
5) Set descriptor ownership bit at the right time for jumbo frames in
stmmac driver, from Aaro Koskinen.
6) Set IFF_UP properly in tun driver, from Eric Dumazet.
7) Fix load/store doubleword instruction generation in powerpc eBPF
JIT, from Naveen N. Rao.
8) nla_nest_start() return value checks all over, from Kangjie Lu.
9) Fix asoc_id handling in SCTP after the SCTP_*_ASSOC changes this
merge window. From Marcelo Ricardo Leitner and Xin Long.
10) Fix memory corruption with large MTUs in stmmac, from Aaro
Koskinen.
11) Do not use ipv4 header for ipv6 flows in TCP and DCCP, from Eric
Dumazet.
12) Fix topology subscription cancellation in tipc, from Erik Hugne.
13) Memory leak in genetlink error path, from Yue Haibing.
14) Valid control actions properly in packet scheduler, from Davide
Caratti.
15) Even if we get EEXIST, we still need to rehash if a shrink was
delayed. From Herbert Xu.
16) Fix interrupt mask handling in interrupt handler of r8169, from
Heiner Kallweit.
17) Fix leak in ehea driver, from Wen Yang"
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (168 commits)
dpaa2-eth: fix race condition with bql frame accounting
chelsio: use BUG() instead of BUG_ON(1)
net: devlink: skip info_get op call if it is not defined in dumpit
net: phy: bcm54xx: Encode link speed and activity into LEDs
tipc: change to check tipc_own_id to return in tipc_net_stop
net: usb: aqc111: Extend HWID table by QNAP device
net: sched: Kconfig: update reference link for PIE
net: dsa: qca8k: extend slave-bus implementations
net: dsa: qca8k: remove leftover phy accessors
dt-bindings: net: dsa: qca8k: support internal mdio-bus
dt-bindings: net: dsa: qca8k: fix example
net: phy: don't clear BMCR in genphy_soft_reset
bpf, libbpf: clarify bump in libbpf version info
bpf, libbpf: fix version info and add it to shared object
rxrpc: avoid clang -Wuninitialized warning
tipc: tipc clang warning
net: sched: fix cleanup NULL pointer exception in act_mirr
r8169: fix cable re-plugging issue
net: ethernet: ti: fix possible object reference leak
net: ibm: fix possible object reference leak
...
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/group.c | 3 | ||||
-rw-r--r-- | net/tipc/net.c | 5 | ||||
-rw-r--r-- | net/tipc/node.c | 7 | ||||
-rw-r--r-- | net/tipc/socket.c | 22 | ||||
-rw-r--r-- | net/tipc/topsrv.c | 1 |
5 files changed, 26 insertions, 12 deletions
diff --git a/net/tipc/group.c b/net/tipc/group.c index 06fee142f09f..63f39201e41e 100644 --- a/net/tipc/group.c +++ b/net/tipc/group.c | |||
@@ -919,6 +919,9 @@ int tipc_group_fill_sock_diag(struct tipc_group *grp, struct sk_buff *skb) | |||
919 | { | 919 | { |
920 | struct nlattr *group = nla_nest_start(skb, TIPC_NLA_SOCK_GROUP); | 920 | struct nlattr *group = nla_nest_start(skb, TIPC_NLA_SOCK_GROUP); |
921 | 921 | ||
922 | if (!group) | ||
923 | return -EMSGSIZE; | ||
924 | |||
922 | if (nla_put_u32(skb, TIPC_NLA_SOCK_GROUP_ID, | 925 | if (nla_put_u32(skb, TIPC_NLA_SOCK_GROUP_ID, |
923 | grp->type) || | 926 | grp->type) || |
924 | nla_put_u32(skb, TIPC_NLA_SOCK_GROUP_INSTANCE, | 927 | nla_put_u32(skb, TIPC_NLA_SOCK_GROUP_INSTANCE, |
diff --git a/net/tipc/net.c b/net/tipc/net.c index f076edb74338..7ce1e86b024f 100644 --- a/net/tipc/net.c +++ b/net/tipc/net.c | |||
@@ -163,12 +163,9 @@ void tipc_sched_net_finalize(struct net *net, u32 addr) | |||
163 | 163 | ||
164 | void tipc_net_stop(struct net *net) | 164 | void tipc_net_stop(struct net *net) |
165 | { | 165 | { |
166 | u32 self = tipc_own_addr(net); | 166 | if (!tipc_own_id(net)) |
167 | |||
168 | if (!self) | ||
169 | return; | 167 | return; |
170 | 168 | ||
171 | tipc_nametbl_withdraw(net, TIPC_CFG_SRV, self, self, self); | ||
172 | rtnl_lock(); | 169 | rtnl_lock(); |
173 | tipc_bearer_stop(net); | 170 | tipc_bearer_stop(net); |
174 | tipc_node_stop(net); | 171 | tipc_node_stop(net); |
diff --git a/net/tipc/node.c b/net/tipc/node.c index 2dc4919ab23c..dd3b6dc17662 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c | |||
@@ -817,10 +817,10 @@ static void __tipc_node_link_down(struct tipc_node *n, int *bearer_id, | |||
817 | static void tipc_node_link_down(struct tipc_node *n, int bearer_id, bool delete) | 817 | static void tipc_node_link_down(struct tipc_node *n, int bearer_id, bool delete) |
818 | { | 818 | { |
819 | struct tipc_link_entry *le = &n->links[bearer_id]; | 819 | struct tipc_link_entry *le = &n->links[bearer_id]; |
820 | struct tipc_media_addr *maddr = NULL; | ||
820 | struct tipc_link *l = le->link; | 821 | struct tipc_link *l = le->link; |
821 | struct tipc_media_addr *maddr; | ||
822 | struct sk_buff_head xmitq; | ||
823 | int old_bearer_id = bearer_id; | 822 | int old_bearer_id = bearer_id; |
823 | struct sk_buff_head xmitq; | ||
824 | 824 | ||
825 | if (!l) | 825 | if (!l) |
826 | return; | 826 | return; |
@@ -844,7 +844,8 @@ static void tipc_node_link_down(struct tipc_node *n, int bearer_id, bool delete) | |||
844 | tipc_node_write_unlock(n); | 844 | tipc_node_write_unlock(n); |
845 | if (delete) | 845 | if (delete) |
846 | tipc_mon_remove_peer(n->net, n->addr, old_bearer_id); | 846 | tipc_mon_remove_peer(n->net, n->addr, old_bearer_id); |
847 | tipc_bearer_xmit(n->net, bearer_id, &xmitq, maddr); | 847 | if (!skb_queue_empty(&xmitq)) |
848 | tipc_bearer_xmit(n->net, bearer_id, &xmitq, maddr); | ||
848 | tipc_sk_rcv(n->net, &le->inputq); | 849 | tipc_sk_rcv(n->net, &le->inputq); |
849 | } | 850 | } |
850 | 851 | ||
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 3274ef625dba..b542f14ed444 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c | |||
@@ -2349,6 +2349,16 @@ static int tipc_wait_for_connect(struct socket *sock, long *timeo_p) | |||
2349 | return 0; | 2349 | return 0; |
2350 | } | 2350 | } |
2351 | 2351 | ||
2352 | static bool tipc_sockaddr_is_sane(struct sockaddr_tipc *addr) | ||
2353 | { | ||
2354 | if (addr->family != AF_TIPC) | ||
2355 | return false; | ||
2356 | if (addr->addrtype == TIPC_SERVICE_RANGE) | ||
2357 | return (addr->addr.nameseq.lower <= addr->addr.nameseq.upper); | ||
2358 | return (addr->addrtype == TIPC_SERVICE_ADDR || | ||
2359 | addr->addrtype == TIPC_SOCKET_ADDR); | ||
2360 | } | ||
2361 | |||
2352 | /** | 2362 | /** |
2353 | * tipc_connect - establish a connection to another TIPC port | 2363 | * tipc_connect - establish a connection to another TIPC port |
2354 | * @sock: socket structure | 2364 | * @sock: socket structure |
@@ -2384,18 +2394,18 @@ static int tipc_connect(struct socket *sock, struct sockaddr *dest, | |||
2384 | if (!tipc_sk_type_connectionless(sk)) | 2394 | if (!tipc_sk_type_connectionless(sk)) |
2385 | res = -EINVAL; | 2395 | res = -EINVAL; |
2386 | goto exit; | 2396 | goto exit; |
2387 | } else if (dst->family != AF_TIPC) { | ||
2388 | res = -EINVAL; | ||
2389 | } | 2397 | } |
2390 | if (dst->addrtype != TIPC_ADDR_ID && dst->addrtype != TIPC_ADDR_NAME) | 2398 | if (!tipc_sockaddr_is_sane(dst)) { |
2391 | res = -EINVAL; | 2399 | res = -EINVAL; |
2392 | if (res) | ||
2393 | goto exit; | 2400 | goto exit; |
2394 | 2401 | } | |
2395 | /* DGRAM/RDM connect(), just save the destaddr */ | 2402 | /* DGRAM/RDM connect(), just save the destaddr */ |
2396 | if (tipc_sk_type_connectionless(sk)) { | 2403 | if (tipc_sk_type_connectionless(sk)) { |
2397 | memcpy(&tsk->peer, dest, destlen); | 2404 | memcpy(&tsk->peer, dest, destlen); |
2398 | goto exit; | 2405 | goto exit; |
2406 | } else if (dst->addrtype == TIPC_SERVICE_RANGE) { | ||
2407 | res = -EINVAL; | ||
2408 | goto exit; | ||
2399 | } | 2409 | } |
2400 | 2410 | ||
2401 | previous = sk->sk_state; | 2411 | previous = sk->sk_state; |
@@ -3255,6 +3265,8 @@ static int __tipc_nl_add_sk_con(struct sk_buff *skb, struct tipc_sock *tsk) | |||
3255 | peer_port = tsk_peer_port(tsk); | 3265 | peer_port = tsk_peer_port(tsk); |
3256 | 3266 | ||
3257 | nest = nla_nest_start(skb, TIPC_NLA_SOCK_CON); | 3267 | nest = nla_nest_start(skb, TIPC_NLA_SOCK_CON); |
3268 | if (!nest) | ||
3269 | return -EMSGSIZE; | ||
3258 | 3270 | ||
3259 | if (nla_put_u32(skb, TIPC_NLA_CON_NODE, peer_node)) | 3271 | if (nla_put_u32(skb, TIPC_NLA_CON_NODE, peer_node)) |
3260 | goto msg_full; | 3272 | goto msg_full; |
diff --git a/net/tipc/topsrv.c b/net/tipc/topsrv.c index 4a708a4e8583..b45932d78004 100644 --- a/net/tipc/topsrv.c +++ b/net/tipc/topsrv.c | |||
@@ -363,6 +363,7 @@ static int tipc_conn_rcv_sub(struct tipc_topsrv *srv, | |||
363 | struct tipc_subscription *sub; | 363 | struct tipc_subscription *sub; |
364 | 364 | ||
365 | if (tipc_sub_read(s, filter) & TIPC_SUB_CANCEL) { | 365 | if (tipc_sub_read(s, filter) & TIPC_SUB_CANCEL) { |
366 | s->filter &= __constant_ntohl(~TIPC_SUB_CANCEL); | ||
366 | tipc_conn_delete_sub(con, s); | 367 | tipc_conn_delete_sub(con, s); |
367 | return 0; | 368 | return 0; |
368 | } | 369 | } |