aboutsummaryrefslogtreecommitdiffstats
path: root/net/netrom
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-04-17 12:57:45 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-04-17 12:57:45 -0400
commit2a3a028fc61d03e80ac57091330eb514280bd5be (patch)
treec0f98d752faa37fed4d11231f08d368dce120786 /net/netrom
parent444fe991353987c1c9bc5ab1f903d01f1b4ad415 (diff)
parente6986423d28362aafe64d3757bbbc493f2687f8f (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Handle init flow failures properly in iwlwifi driver, from Shahar S Matityahu. 2) mac80211 TXQs need to be unscheduled on powersave start, from Felix Fietkau. 3) SKB memory accounting fix in A-MDSU aggregation, from Felix Fietkau. 4) Increase RCU lock hold time in mlx5 FPGA code, from Saeed Mahameed. 5) Avoid checksum complete with XDP in mlx5, also from Saeed. 6) Fix netdev feature clobbering in ibmvnic driver, from Thomas Falcon. 7) Partial sent TLS record leak fix from Jakub Kicinski. 8) Reject zero size iova range in vhost, from Jason Wang. 9) Allow pending work to complete before clcsock release from Karsten Graul. 10) Fix XDP handling max MTU in thunderx, from Matteo Croce. 11) A lot of protocols look at the sa_family field of a sockaddr before validating it's length is large enough, from Tetsuo Handa. 12) Don't write to free'd pointer in qede ptp error path, from Colin Ian King. 13) Have to recompile IP options in ipv4_link_failure because it can be invoked from ARP, from Stephen Suryaputra. 14) Doorbell handling fixes in qed from Denis Bolotin. 15) Revert net-sysfs kobject register leak fix, it causes new problems. From Wang Hai. 16) Spectre v1 fix in ATM code, from Gustavo A. R. Silva. 17) Fix put of BROPT_VLAN_STATS_PER_PORT in bridging code, from Nikolay Aleksandrov. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (111 commits) socket: fix compat SO_RCVTIMEO_NEW/SO_SNDTIMEO_NEW tcp: tcp_grow_window() needs to respect tcp_space() ocelot: Clean up stats update deferred work ocelot: Don't sleep in atomic context (irqs_disabled()) net: bridge: fix netlink export of vlan_stats_per_port option qed: fix spelling mistake "faspath" -> "fastpath" tipc: set sysctl_tipc_rmem and named_timeout right range tipc: fix link established but not in session net: Fix missing meta data in skb with vlan packet net: atm: Fix potential Spectre v1 vulnerabilities net/core: work around section mismatch warning for ptp_classifier net: bridge: fix per-port af_packet sockets bnx2x: fix spelling mistake "dicline" -> "decline" route: Avoid crash from dereferencing NULL rt->from MAINTAINERS: normalize Woojung Huh's email address bonding: fix event handling for stacked bonds Revert "net-sysfs: Fix memory leak in netdev_register_kobject" rtnetlink: fix rtnl_valid_stats_req() nlmsg_len check qed: Fix the DORQ's attentions handling qed: Fix missing DORQ attentions ...
Diffstat (limited to 'net/netrom')
-rw-r--r--net/netrom/af_netrom.c76
-rw-r--r--net/netrom/nr_loopback.c2
-rw-r--r--net/netrom/nr_route.c2
-rw-r--r--net/netrom/sysctl_net_netrom.c5
4 files changed, 60 insertions, 25 deletions
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index 1d3144d19903..71ffd1a6dc7c 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -1392,18 +1392,22 @@ static int __init nr_proto_init(void)
1392 int i; 1392 int i;
1393 int rc = proto_register(&nr_proto, 0); 1393 int rc = proto_register(&nr_proto, 0);
1394 1394
1395 if (rc != 0) 1395 if (rc)
1396 goto out; 1396 return rc;
1397 1397
1398 if (nr_ndevs > 0x7fffffff/sizeof(struct net_device *)) { 1398 if (nr_ndevs > 0x7fffffff/sizeof(struct net_device *)) {
1399 printk(KERN_ERR "NET/ROM: nr_proto_init - nr_ndevs parameter to large\n"); 1399 pr_err("NET/ROM: %s - nr_ndevs parameter too large\n",
1400 return -1; 1400 __func__);
1401 rc = -EINVAL;
1402 goto unregister_proto;
1401 } 1403 }
1402 1404
1403 dev_nr = kcalloc(nr_ndevs, sizeof(struct net_device *), GFP_KERNEL); 1405 dev_nr = kcalloc(nr_ndevs, sizeof(struct net_device *), GFP_KERNEL);
1404 if (dev_nr == NULL) { 1406 if (!dev_nr) {
1405 printk(KERN_ERR "NET/ROM: nr_proto_init - unable to allocate device array\n"); 1407 pr_err("NET/ROM: %s - unable to allocate device array\n",
1406 return -1; 1408 __func__);
1409 rc = -ENOMEM;
1410 goto unregister_proto;
1407 } 1411 }
1408 1412
1409 for (i = 0; i < nr_ndevs; i++) { 1413 for (i = 0; i < nr_ndevs; i++) {
@@ -1413,13 +1417,13 @@ static int __init nr_proto_init(void)
1413 sprintf(name, "nr%d", i); 1417 sprintf(name, "nr%d", i);
1414 dev = alloc_netdev(0, name, NET_NAME_UNKNOWN, nr_setup); 1418 dev = alloc_netdev(0, name, NET_NAME_UNKNOWN, nr_setup);
1415 if (!dev) { 1419 if (!dev) {
1416 printk(KERN_ERR "NET/ROM: nr_proto_init - unable to allocate device structure\n"); 1420 rc = -ENOMEM;
1417 goto fail; 1421 goto fail;
1418 } 1422 }
1419 1423
1420 dev->base_addr = i; 1424 dev->base_addr = i;
1421 if (register_netdev(dev)) { 1425 rc = register_netdev(dev);
1422 printk(KERN_ERR "NET/ROM: nr_proto_init - unable to register network device\n"); 1426 if (rc) {
1423 free_netdev(dev); 1427 free_netdev(dev);
1424 goto fail; 1428 goto fail;
1425 } 1429 }
@@ -1427,36 +1431,64 @@ static int __init nr_proto_init(void)
1427 dev_nr[i] = dev; 1431 dev_nr[i] = dev;
1428 } 1432 }
1429 1433
1430 if (sock_register(&nr_family_ops)) { 1434 rc = sock_register(&nr_family_ops);
1431 printk(KERN_ERR "NET/ROM: nr_proto_init - unable to register socket family\n"); 1435 if (rc)
1432 goto fail; 1436 goto fail;
1433 }
1434 1437
1435 register_netdevice_notifier(&nr_dev_notifier); 1438 rc = register_netdevice_notifier(&nr_dev_notifier);
1439 if (rc)
1440 goto out_sock;
1436 1441
1437 ax25_register_pid(&nr_pid); 1442 ax25_register_pid(&nr_pid);
1438 ax25_linkfail_register(&nr_linkfail_notifier); 1443 ax25_linkfail_register(&nr_linkfail_notifier);
1439 1444
1440#ifdef CONFIG_SYSCTL 1445#ifdef CONFIG_SYSCTL
1441 nr_register_sysctl(); 1446 rc = nr_register_sysctl();
1447 if (rc)
1448 goto out_sysctl;
1442#endif 1449#endif
1443 1450
1444 nr_loopback_init(); 1451 nr_loopback_init();
1445 1452
1446 proc_create_seq("nr", 0444, init_net.proc_net, &nr_info_seqops); 1453 rc = -ENOMEM;
1447 proc_create_seq("nr_neigh", 0444, init_net.proc_net, &nr_neigh_seqops); 1454 if (!proc_create_seq("nr", 0444, init_net.proc_net, &nr_info_seqops))
1448 proc_create_seq("nr_nodes", 0444, init_net.proc_net, &nr_node_seqops); 1455 goto proc_remove1;
1449out: 1456 if (!proc_create_seq("nr_neigh", 0444, init_net.proc_net,
1450 return rc; 1457 &nr_neigh_seqops))
1458 goto proc_remove2;
1459 if (!proc_create_seq("nr_nodes", 0444, init_net.proc_net,
1460 &nr_node_seqops))
1461 goto proc_remove3;
1462
1463 return 0;
1464
1465proc_remove3:
1466 remove_proc_entry("nr_neigh", init_net.proc_net);
1467proc_remove2:
1468 remove_proc_entry("nr", init_net.proc_net);
1469proc_remove1:
1470
1471 nr_loopback_clear();
1472 nr_rt_free();
1473
1474#ifdef CONFIG_SYSCTL
1475 nr_unregister_sysctl();
1476out_sysctl:
1477#endif
1478 ax25_linkfail_release(&nr_linkfail_notifier);
1479 ax25_protocol_release(AX25_P_NETROM);
1480 unregister_netdevice_notifier(&nr_dev_notifier);
1481out_sock:
1482 sock_unregister(PF_NETROM);
1451fail: 1483fail:
1452 while (--i >= 0) { 1484 while (--i >= 0) {
1453 unregister_netdev(dev_nr[i]); 1485 unregister_netdev(dev_nr[i]);
1454 free_netdev(dev_nr[i]); 1486 free_netdev(dev_nr[i]);
1455 } 1487 }
1456 kfree(dev_nr); 1488 kfree(dev_nr);
1489unregister_proto:
1457 proto_unregister(&nr_proto); 1490 proto_unregister(&nr_proto);
1458 rc = -1; 1491 return rc;
1459 goto out;
1460} 1492}
1461 1493
1462module_init(nr_proto_init); 1494module_init(nr_proto_init);
diff --git a/net/netrom/nr_loopback.c b/net/netrom/nr_loopback.c
index 215ad22a9647..93d13f019981 100644
--- a/net/netrom/nr_loopback.c
+++ b/net/netrom/nr_loopback.c
@@ -70,7 +70,7 @@ static void nr_loopback_timer(struct timer_list *unused)
70 } 70 }
71} 71}
72 72
73void __exit nr_loopback_clear(void) 73void nr_loopback_clear(void)
74{ 74{
75 del_timer_sync(&loopback_timer); 75 del_timer_sync(&loopback_timer);
76 skb_queue_purge(&loopback_queue); 76 skb_queue_purge(&loopback_queue);
diff --git a/net/netrom/nr_route.c b/net/netrom/nr_route.c
index 6485f593e2f0..b76aa668a94b 100644
--- a/net/netrom/nr_route.c
+++ b/net/netrom/nr_route.c
@@ -953,7 +953,7 @@ const struct seq_operations nr_neigh_seqops = {
953/* 953/*
954 * Free all memory associated with the nodes and routes lists. 954 * Free all memory associated with the nodes and routes lists.
955 */ 955 */
956void __exit nr_rt_free(void) 956void nr_rt_free(void)
957{ 957{
958 struct nr_neigh *s = NULL; 958 struct nr_neigh *s = NULL;
959 struct nr_node *t = NULL; 959 struct nr_node *t = NULL;
diff --git a/net/netrom/sysctl_net_netrom.c b/net/netrom/sysctl_net_netrom.c
index ba1c368b3f18..771011b84270 100644
--- a/net/netrom/sysctl_net_netrom.c
+++ b/net/netrom/sysctl_net_netrom.c
@@ -146,9 +146,12 @@ static struct ctl_table nr_table[] = {
146 { } 146 { }
147}; 147};
148 148
149void __init nr_register_sysctl(void) 149int __init nr_register_sysctl(void)
150{ 150{
151 nr_table_header = register_net_sysctl(&init_net, "net/netrom", nr_table); 151 nr_table_header = register_net_sysctl(&init_net, "net/netrom", nr_table);
152 if (!nr_table_header)
153 return -ENOMEM;
154 return 0;
152} 155}
153 156
154void nr_unregister_sysctl(void) 157void nr_unregister_sysctl(void)