Skip to content

Commit a090bd4

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) The netlink attribute passed in to dev_set_alias() is not necessarily NULL terminated, don't use strlcpy() on it. From Alexander Potapenko. 2) Fix implementation of atomics in arm64 bpf JIT, from Daniel Borkmann. 3) Correct the release of netdevs and driver private data in certain circumstances. 4) Sanitize netlink message length properly in decnet, from Mateusz Jurczyk. 5) Don't leak kernel data in rtnl_fill_vfinfo() netlink blobs. From Yuval Mintz. 6) Hash secret is never initialized in ipv6 ILA translation code, from Arnd Bergmann. I guess those clang warnings about unused inline functions are useful for something! 7) Fix endian selection in bpf_endian.h, from Daniel Borkmann. 8) Sanitize sockaddr length before dereferncing any fields in AF_UNIX and CAIF. From Mateusz Jurczyk. 9) Fix timestamping for GMAC3 chips in stmmac driver, from Mario Molitor. 10) Do not leak netdev on dev_alloc_name() errors in mac80211, from Johannes Berg. 11) Fix locking in sctp_for_each_endpoint(), from Xin Long. 12) Fix wrong memset size on 32-bit in snmp6, from Christian Perle. 13) Fix use after free in ip_mc_clear_src(), from WANG Cong. 14) Fix regressions caused by ICMP rate limiting changes in 4.11, from Jesper Dangaard Brouer. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (91 commits) i40e: Fix a sleep-in-atomic bug net: don't global ICMP rate limit packets originating from loopback net/act_pedit: fix an error code net: update undefined ->ndo_change_mtu() comment net_sched: move tcf_lock down after gen_replace_estimator() caif: Add sockaddr length check before accessing sa_family in connect handler qed: fix dump of context data qmi_wwan: new Telewell and Sierra device IDs net: phy: Fix MDIO_THUNDER dependencies netconsole: Remove duplicate "netconsole: " logging prefix igmp: acquire pmc lock for ip_mc_clear_src() r8152: give the device version net: rps: fix uninitialized symbol warning mac80211: don't send SMPS action frame in AP mode when not needed mac80211/wpa: use constant time memory comparison for MACs mac80211: set bss_info data before configuring the channel mac80211: remove 5/10 MHz rate code from station MLME mac80211: Fix incorrect condition when checking rx timestamp mac80211: don't look at the PM bit of BAR frames i40e: fix handling of HW ATR eviction ...
2 parents 54ed0f7 + 640f93c commit a090bd4

File tree

136 files changed

+810
-491
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+810
-491
lines changed

Documentation/networking/scaling.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ associated flow of the packet. The hash is either provided by hardware
122122
or will be computed in the stack. Capable hardware can pass the hash in
123123
the receive descriptor for the packet; this would usually be the same
124124
hash used for RSS (e.g. computed Toeplitz hash). The hash is saved in
125-
skb->rx_hash and can be used elsewhere in the stack as a hash of the
125+
skb->hash and can be used elsewhere in the stack as a hash of the
126126
packet’s flow.
127127

128128
Each receive hardware queue has an associated list of CPUs to which

arch/arm64/net/bpf_jit_comp.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ int bpf_jit_enable __read_mostly;
3636
#define TMP_REG_1 (MAX_BPF_JIT_REG + 0)
3737
#define TMP_REG_2 (MAX_BPF_JIT_REG + 1)
3838
#define TCALL_CNT (MAX_BPF_JIT_REG + 2)
39+
#define TMP_REG_3 (MAX_BPF_JIT_REG + 3)
3940

4041
/* Map BPF registers to A64 registers */
4142
static const int bpf2a64[] = {
@@ -57,6 +58,7 @@ static const int bpf2a64[] = {
5758
/* temporary registers for internal BPF JIT */
5859
[TMP_REG_1] = A64_R(10),
5960
[TMP_REG_2] = A64_R(11),
61+
[TMP_REG_3] = A64_R(12),
6062
/* tail_call_cnt */
6163
[TCALL_CNT] = A64_R(26),
6264
/* temporary register for blinding constants */
@@ -319,6 +321,7 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx)
319321
const u8 src = bpf2a64[insn->src_reg];
320322
const u8 tmp = bpf2a64[TMP_REG_1];
321323
const u8 tmp2 = bpf2a64[TMP_REG_2];
324+
const u8 tmp3 = bpf2a64[TMP_REG_3];
322325
const s16 off = insn->off;
323326
const s32 imm = insn->imm;
324327
const int i = insn - ctx->prog->insnsi;
@@ -689,10 +692,10 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx)
689692
emit(A64_PRFM(tmp, PST, L1, STRM), ctx);
690693
emit(A64_LDXR(isdw, tmp2, tmp), ctx);
691694
emit(A64_ADD(isdw, tmp2, tmp2, src), ctx);
692-
emit(A64_STXR(isdw, tmp2, tmp, tmp2), ctx);
695+
emit(A64_STXR(isdw, tmp2, tmp, tmp3), ctx);
693696
jmp_offset = -3;
694697
check_imm19(jmp_offset);
695-
emit(A64_CBNZ(0, tmp2, jmp_offset), ctx);
698+
emit(A64_CBNZ(0, tmp3, jmp_offset), ctx);
696699
break;
697700

698701
/* R0 = ntohx(*(size *)(((struct sk_buff *)R6)->data + imm)) */

drivers/hsi/clients/ssi_protocol.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,7 @@ static void ssip_pn_setup(struct net_device *dev)
10661066
dev->addr_len = 1;
10671067
dev->tx_queue_len = SSIP_TXQUEUE_LEN;
10681068

1069-
dev->destructor = free_netdev;
1069+
dev->needs_free_netdev = true;
10701070
dev->header_ops = &phonet_header_ops;
10711071
}
10721072

drivers/net/bonding/bond_3ad.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,13 @@ enum ad_link_speed_type {
9090
AD_LINK_SPEED_100MBPS,
9191
AD_LINK_SPEED_1000MBPS,
9292
AD_LINK_SPEED_2500MBPS,
93+
AD_LINK_SPEED_5000MBPS,
9394
AD_LINK_SPEED_10000MBPS,
95+
AD_LINK_SPEED_14000MBPS,
9496
AD_LINK_SPEED_20000MBPS,
9597
AD_LINK_SPEED_25000MBPS,
9698
AD_LINK_SPEED_40000MBPS,
99+
AD_LINK_SPEED_50000MBPS,
97100
AD_LINK_SPEED_56000MBPS,
98101
AD_LINK_SPEED_100000MBPS,
99102
};
@@ -259,10 +262,13 @@ static inline int __check_agg_selection_timer(struct port *port)
259262
* %AD_LINK_SPEED_100MBPS,
260263
* %AD_LINK_SPEED_1000MBPS,
261264
* %AD_LINK_SPEED_2500MBPS,
265+
* %AD_LINK_SPEED_5000MBPS,
262266
* %AD_LINK_SPEED_10000MBPS
267+
* %AD_LINK_SPEED_14000MBPS,
263268
* %AD_LINK_SPEED_20000MBPS
264269
* %AD_LINK_SPEED_25000MBPS
265270
* %AD_LINK_SPEED_40000MBPS
271+
* %AD_LINK_SPEED_50000MBPS
266272
* %AD_LINK_SPEED_56000MBPS
267273
* %AD_LINK_SPEED_100000MBPS
268274
*/
@@ -296,10 +302,18 @@ static u16 __get_link_speed(struct port *port)
296302
speed = AD_LINK_SPEED_2500MBPS;
297303
break;
298304

305+
case SPEED_5000:
306+
speed = AD_LINK_SPEED_5000MBPS;
307+
break;
308+
299309
case SPEED_10000:
300310
speed = AD_LINK_SPEED_10000MBPS;
301311
break;
302312

313+
case SPEED_14000:
314+
speed = AD_LINK_SPEED_14000MBPS;
315+
break;
316+
303317
case SPEED_20000:
304318
speed = AD_LINK_SPEED_20000MBPS;
305319
break;
@@ -312,6 +326,10 @@ static u16 __get_link_speed(struct port *port)
312326
speed = AD_LINK_SPEED_40000MBPS;
313327
break;
314328

329+
case SPEED_50000:
330+
speed = AD_LINK_SPEED_50000MBPS;
331+
break;
332+
315333
case SPEED_56000:
316334
speed = AD_LINK_SPEED_56000MBPS;
317335
break;
@@ -707,9 +725,15 @@ static u32 __get_agg_bandwidth(struct aggregator *aggregator)
707725
case AD_LINK_SPEED_2500MBPS:
708726
bandwidth = nports * 2500;
709727
break;
728+
case AD_LINK_SPEED_5000MBPS:
729+
bandwidth = nports * 5000;
730+
break;
710731
case AD_LINK_SPEED_10000MBPS:
711732
bandwidth = nports * 10000;
712733
break;
734+
case AD_LINK_SPEED_14000MBPS:
735+
bandwidth = nports * 14000;
736+
break;
713737
case AD_LINK_SPEED_20000MBPS:
714738
bandwidth = nports * 20000;
715739
break;
@@ -719,6 +743,9 @@ static u32 __get_agg_bandwidth(struct aggregator *aggregator)
719743
case AD_LINK_SPEED_40000MBPS:
720744
bandwidth = nports * 40000;
721745
break;
746+
case AD_LINK_SPEED_50000MBPS:
747+
bandwidth = nports * 50000;
748+
break;
722749
case AD_LINK_SPEED_56000MBPS:
723750
bandwidth = nports * 56000;
724751
break;

drivers/net/bonding/bond_main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4192,7 +4192,6 @@ static void bond_destructor(struct net_device *bond_dev)
41924192
struct bonding *bond = netdev_priv(bond_dev);
41934193
if (bond->wq)
41944194
destroy_workqueue(bond->wq);
4195-
free_netdev(bond_dev);
41964195
}
41974196

41984197
void bond_setup(struct net_device *bond_dev)
@@ -4212,7 +4211,8 @@ void bond_setup(struct net_device *bond_dev)
42124211
bond_dev->netdev_ops = &bond_netdev_ops;
42134212
bond_dev->ethtool_ops = &bond_ethtool_ops;
42144213

4215-
bond_dev->destructor = bond_destructor;
4214+
bond_dev->needs_free_netdev = true;
4215+
bond_dev->priv_destructor = bond_destructor;
42164216

42174217
SET_NETDEV_DEVTYPE(bond_dev, &bond_type);
42184218

@@ -4736,7 +4736,7 @@ int bond_create(struct net *net, const char *name)
47364736

47374737
rtnl_unlock();
47384738
if (res < 0)
4739-
bond_destructor(bond_dev);
4739+
free_netdev(bond_dev);
47404740
return res;
47414741
}
47424742

drivers/net/caif/caif_hsi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ static void cfhsi_setup(struct net_device *dev)
11211121
dev->flags = IFF_POINTOPOINT | IFF_NOARP;
11221122
dev->mtu = CFHSI_MAX_CAIF_FRAME_SZ;
11231123
dev->priv_flags |= IFF_NO_QUEUE;
1124-
dev->destructor = free_netdev;
1124+
dev->needs_free_netdev = true;
11251125
dev->netdev_ops = &cfhsi_netdevops;
11261126
for (i = 0; i < CFHSI_PRIO_LAST; ++i)
11271127
skb_queue_head_init(&cfhsi->qhead[i]);

drivers/net/caif/caif_serial.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ static void caifdev_setup(struct net_device *dev)
428428
dev->flags = IFF_POINTOPOINT | IFF_NOARP;
429429
dev->mtu = CAIF_MAX_MTU;
430430
dev->priv_flags |= IFF_NO_QUEUE;
431-
dev->destructor = free_netdev;
431+
dev->needs_free_netdev = true;
432432
skb_queue_head_init(&serdev->head);
433433
serdev->common.link_select = CAIF_LINK_LOW_LATENCY;
434434
serdev->common.use_frag = true;

drivers/net/caif/caif_spi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ static void cfspi_setup(struct net_device *dev)
712712
dev->flags = IFF_NOARP | IFF_POINTOPOINT;
713713
dev->priv_flags |= IFF_NO_QUEUE;
714714
dev->mtu = SPI_MAX_PAYLOAD_SIZE;
715-
dev->destructor = free_netdev;
715+
dev->needs_free_netdev = true;
716716
skb_queue_head_init(&cfspi->qhead);
717717
skb_queue_head_init(&cfspi->chead);
718718
cfspi->cfdev.link_select = CAIF_LINK_HIGH_BANDW;

drivers/net/caif/caif_virtio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ static void cfv_netdev_setup(struct net_device *netdev)
617617
netdev->tx_queue_len = 100;
618618
netdev->flags = IFF_POINTOPOINT | IFF_NOARP;
619619
netdev->mtu = CFV_DEF_MTU_SIZE;
620-
netdev->destructor = free_netdev;
620+
netdev->needs_free_netdev = true;
621621
}
622622

623623
/* Create debugfs counters for the device */

drivers/net/can/dev.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,9 @@ void can_change_state(struct net_device *dev, struct can_frame *cf,
391391
can_update_state_error_stats(dev, new_state);
392392
priv->state = new_state;
393393

394+
if (!cf)
395+
return;
396+
394397
if (unlikely(new_state == CAN_STATE_BUS_OFF)) {
395398
cf->can_id |= CAN_ERR_BUSOFF;
396399
return;

drivers/net/can/peak_canfd/peak_canfd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ int peak_canfd_handle_msgs_list(struct peak_canfd_priv *priv,
489489
struct pucan_rx_msg *msg_list, int msg_count)
490490
{
491491
void *msg_ptr = msg_list;
492-
int i, msg_size;
492+
int i, msg_size = 0;
493493

494494
for (i = 0; i < msg_count; i++) {
495495
msg_size = peak_canfd_handle_msg(priv, msg_ptr);

drivers/net/can/slcan.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ static int slc_open(struct net_device *dev)
417417
static void slc_free_netdev(struct net_device *dev)
418418
{
419419
int i = dev->base_addr;
420-
free_netdev(dev);
420+
421421
slcan_devs[i] = NULL;
422422
}
423423

@@ -436,7 +436,8 @@ static const struct net_device_ops slc_netdev_ops = {
436436
static void slc_setup(struct net_device *dev)
437437
{
438438
dev->netdev_ops = &slc_netdev_ops;
439-
dev->destructor = slc_free_netdev;
439+
dev->needs_free_netdev = true;
440+
dev->priv_destructor = slc_free_netdev;
440441

441442
dev->hard_header_len = 0;
442443
dev->addr_len = 0;
@@ -761,8 +762,6 @@ static void __exit slcan_exit(void)
761762
if (sl->tty) {
762763
printk(KERN_ERR "%s: tty discipline still running\n",
763764
dev->name);
764-
/* Intentionally leak the control block. */
765-
dev->destructor = NULL;
766765
}
767766

768767
unregister_netdev(dev);

drivers/net/can/usb/gs_usb.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,8 @@ static int gs_cmd_reset(struct gs_usb *gsusb, struct gs_can *gsdev)
265265
sizeof(*dm),
266266
1000);
267267

268+
kfree(dm);
269+
268270
return rc;
269271
}
270272

drivers/net/can/usb/peak_usb/pcan_usb_core.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -908,8 +908,6 @@ static int peak_usb_probe(struct usb_interface *intf,
908908
const struct peak_usb_adapter *peak_usb_adapter = NULL;
909909
int i, err = -ENOMEM;
910910

911-
usb_dev = interface_to_usbdev(intf);
912-
913911
/* get corresponding PCAN-USB adapter */
914912
for (i = 0; i < ARRAY_SIZE(peak_usb_adapters_list); i++)
915913
if (peak_usb_adapters_list[i]->device_id == usb_id_product) {
@@ -920,7 +918,7 @@ static int peak_usb_probe(struct usb_interface *intf,
920918
if (!peak_usb_adapter) {
921919
/* should never come except device_id bad usage in this file */
922920
pr_err("%s: didn't find device id. 0x%x in devices list\n",
923-
PCAN_USB_DRIVER_NAME, usb_dev->descriptor.idProduct);
921+
PCAN_USB_DRIVER_NAME, usb_id_product);
924922
return -ENODEV;
925923
}
926924

drivers/net/can/vcan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ static const struct net_device_ops vcan_netdev_ops = {
152152
static void vcan_setup(struct net_device *dev)
153153
{
154154
dev->type = ARPHRD_CAN;
155-
dev->mtu = CAN_MTU;
155+
dev->mtu = CANFD_MTU;
156156
dev->hard_header_len = 0;
157157
dev->addr_len = 0;
158158
dev->tx_queue_len = 0;
@@ -163,7 +163,7 @@ static void vcan_setup(struct net_device *dev)
163163
dev->flags |= IFF_ECHO;
164164

165165
dev->netdev_ops = &vcan_netdev_ops;
166-
dev->destructor = free_netdev;
166+
dev->needs_free_netdev = true;
167167
}
168168

169169
static struct rtnl_link_ops vcan_link_ops __read_mostly = {

drivers/net/can/vxcan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,13 @@ static const struct net_device_ops vxcan_netdev_ops = {
150150
static void vxcan_setup(struct net_device *dev)
151151
{
152152
dev->type = ARPHRD_CAN;
153-
dev->mtu = CAN_MTU;
153+
dev->mtu = CANFD_MTU;
154154
dev->hard_header_len = 0;
155155
dev->addr_len = 0;
156156
dev->tx_queue_len = 0;
157157
dev->flags = (IFF_NOARP|IFF_ECHO);
158158
dev->netdev_ops = &vxcan_netdev_ops;
159-
dev->destructor = free_netdev;
159+
dev->needs_free_netdev = true;
160160
}
161161

162162
/* forward declaration for rtnl_create_link() */

drivers/net/dummy.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,6 @@ static void dummy_free_netdev(struct net_device *dev)
328328
struct dummy_priv *priv = netdev_priv(dev);
329329

330330
kfree(priv->vfinfo);
331-
free_netdev(dev);
332331
}
333332

334333
static void dummy_setup(struct net_device *dev)
@@ -338,7 +337,8 @@ static void dummy_setup(struct net_device *dev)
338337
/* Initialize the device structure. */
339338
dev->netdev_ops = &dummy_netdev_ops;
340339
dev->ethtool_ops = &dummy_ethtool_ops;
341-
dev->destructor = dummy_free_netdev;
340+
dev->needs_free_netdev = true;
341+
dev->priv_destructor = dummy_free_netdev;
342342

343343
/* Fill in device structure with ethernet-generic values. */
344344
dev->flags |= IFF_NOARP;

0 commit comments

Comments
 (0)