diff options
| author | David S. Miller <davem@davemloft.net> | 2019-04-17 14:26:25 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2019-04-17 14:26:25 -0400 |
| commit | 6b0a7f84ea1fe248df96ccc4dd86e817e32ef65b (patch) | |
| tree | 0a7976054052e793da782c2b7ec34eccfbf66449 /net/core | |
| parent | cea0aa9cbd5ad4efe267e9487ed5d48d16756253 (diff) | |
| parent | fe5cdef29e41c8bda8cd1a11545e7c6bfe25570e (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflict resolution of af_smc.c from Stephen Rothwell.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
| -rw-r--r-- | net/core/dev.c | 16 | ||||
| -rw-r--r-- | net/core/failover.c | 6 | ||||
| -rw-r--r-- | net/core/filter.c | 2 | ||||
| -rw-r--r-- | net/core/net-sysfs.c | 14 | ||||
| -rw-r--r-- | net/core/ptp_classifier.c | 7 | ||||
| -rw-r--r-- | net/core/rtnetlink.c | 2 | ||||
| -rw-r--r-- | net/core/skbuff.c | 10 | ||||
| -rw-r--r-- | net/core/sock.c | 4 |
8 files changed, 41 insertions, 20 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index b430f851f377..22f2640f559a 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -1184,7 +1184,21 @@ int dev_change_name(struct net_device *dev, const char *newname) | |||
| 1184 | BUG_ON(!dev_net(dev)); | 1184 | BUG_ON(!dev_net(dev)); |
| 1185 | 1185 | ||
| 1186 | net = dev_net(dev); | 1186 | net = dev_net(dev); |
| 1187 | if (dev->flags & IFF_UP) | 1187 | |
| 1188 | /* Some auto-enslaved devices e.g. failover slaves are | ||
| 1189 | * special, as userspace might rename the device after | ||
| 1190 | * the interface had been brought up and running since | ||
| 1191 | * the point kernel initiated auto-enslavement. Allow | ||
| 1192 | * live name change even when these slave devices are | ||
| 1193 | * up and running. | ||
| 1194 | * | ||
| 1195 | * Typically, users of these auto-enslaving devices | ||
| 1196 | * don't actually care about slave name change, as | ||
| 1197 | * they are supposed to operate on master interface | ||
| 1198 | * directly. | ||
| 1199 | */ | ||
| 1200 | if (dev->flags & IFF_UP && | ||
| 1201 | likely(!(dev->priv_flags & IFF_LIVE_RENAME_OK))) | ||
| 1188 | return -EBUSY; | 1202 | return -EBUSY; |
| 1189 | 1203 | ||
| 1190 | write_seqcount_begin(&devnet_rename_seq); | 1204 | write_seqcount_begin(&devnet_rename_seq); |
diff --git a/net/core/failover.c b/net/core/failover.c index 4a92a98ccce9..b5cd3c727285 100644 --- a/net/core/failover.c +++ b/net/core/failover.c | |||
| @@ -80,14 +80,14 @@ static int failover_slave_register(struct net_device *slave_dev) | |||
| 80 | goto err_upper_link; | 80 | goto err_upper_link; |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | slave_dev->priv_flags |= IFF_FAILOVER_SLAVE; | 83 | slave_dev->priv_flags |= (IFF_FAILOVER_SLAVE | IFF_LIVE_RENAME_OK); |
| 84 | 84 | ||
| 85 | if (fops && fops->slave_register && | 85 | if (fops && fops->slave_register && |
| 86 | !fops->slave_register(slave_dev, failover_dev)) | 86 | !fops->slave_register(slave_dev, failover_dev)) |
| 87 | return NOTIFY_OK; | 87 | return NOTIFY_OK; |
| 88 | 88 | ||
| 89 | netdev_upper_dev_unlink(slave_dev, failover_dev); | 89 | netdev_upper_dev_unlink(slave_dev, failover_dev); |
| 90 | slave_dev->priv_flags &= ~IFF_FAILOVER_SLAVE; | 90 | slave_dev->priv_flags &= ~(IFF_FAILOVER_SLAVE | IFF_LIVE_RENAME_OK); |
| 91 | err_upper_link: | 91 | err_upper_link: |
| 92 | netdev_rx_handler_unregister(slave_dev); | 92 | netdev_rx_handler_unregister(slave_dev); |
| 93 | done: | 93 | done: |
| @@ -121,7 +121,7 @@ int failover_slave_unregister(struct net_device *slave_dev) | |||
| 121 | 121 | ||
| 122 | netdev_rx_handler_unregister(slave_dev); | 122 | netdev_rx_handler_unregister(slave_dev); |
| 123 | netdev_upper_dev_unlink(slave_dev, failover_dev); | 123 | netdev_upper_dev_unlink(slave_dev, failover_dev); |
| 124 | slave_dev->priv_flags &= ~IFF_FAILOVER_SLAVE; | 124 | slave_dev->priv_flags &= ~(IFF_FAILOVER_SLAVE | IFF_LIVE_RENAME_OK); |
| 125 | 125 | ||
| 126 | if (fops && fops->slave_unregister && | 126 | if (fops && fops->slave_unregister && |
| 127 | !fops->slave_unregister(slave_dev, failover_dev)) | 127 | !fops->slave_unregister(slave_dev, failover_dev)) |
diff --git a/net/core/filter.c b/net/core/filter.c index 95a27fdf9a40..07687e2a2e66 100644 --- a/net/core/filter.c +++ b/net/core/filter.c | |||
| @@ -4462,6 +4462,8 @@ BPF_CALL_3(bpf_bind, struct bpf_sock_addr_kern *, ctx, struct sockaddr *, addr, | |||
| 4462 | * Only binding to IP is supported. | 4462 | * Only binding to IP is supported. |
| 4463 | */ | 4463 | */ |
| 4464 | err = -EINVAL; | 4464 | err = -EINVAL; |
| 4465 | if (addr_len < offsetofend(struct sockaddr, sa_family)) | ||
| 4466 | return err; | ||
| 4465 | if (addr->sa_family == AF_INET) { | 4467 | if (addr->sa_family == AF_INET) { |
| 4466 | if (addr_len < sizeof(struct sockaddr_in)) | 4468 | if (addr_len < sizeof(struct sockaddr_in)) |
| 4467 | return err; | 4469 | return err; |
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index c14f0dc0157c..e4fd68389d6f 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c | |||
| @@ -1747,20 +1747,16 @@ int netdev_register_kobject(struct net_device *ndev) | |||
| 1747 | 1747 | ||
| 1748 | error = device_add(dev); | 1748 | error = device_add(dev); |
| 1749 | if (error) | 1749 | if (error) |
| 1750 | goto error_put_device; | 1750 | return error; |
| 1751 | 1751 | ||
| 1752 | error = register_queue_kobjects(ndev); | 1752 | error = register_queue_kobjects(ndev); |
| 1753 | if (error) | 1753 | if (error) { |
| 1754 | goto error_device_del; | 1754 | device_del(dev); |
| 1755 | return error; | ||
| 1756 | } | ||
| 1755 | 1757 | ||
| 1756 | pm_runtime_set_memalloc_noio(dev, true); | 1758 | pm_runtime_set_memalloc_noio(dev, true); |
| 1757 | 1759 | ||
| 1758 | return 0; | ||
| 1759 | |||
| 1760 | error_device_del: | ||
| 1761 | device_del(dev); | ||
| 1762 | error_put_device: | ||
| 1763 | put_device(dev); | ||
| 1764 | return error; | 1760 | return error; |
| 1765 | } | 1761 | } |
| 1766 | 1762 | ||
diff --git a/net/core/ptp_classifier.c b/net/core/ptp_classifier.c index 703cf76aa7c2..7109c168b5e0 100644 --- a/net/core/ptp_classifier.c +++ b/net/core/ptp_classifier.c | |||
| @@ -185,9 +185,10 @@ void __init ptp_classifier_init(void) | |||
| 185 | { 0x16, 0, 0, 0x00000000 }, | 185 | { 0x16, 0, 0, 0x00000000 }, |
| 186 | { 0x06, 0, 0, 0x00000000 }, | 186 | { 0x06, 0, 0, 0x00000000 }, |
| 187 | }; | 187 | }; |
| 188 | struct sock_fprog_kern ptp_prog = { | 188 | struct sock_fprog_kern ptp_prog; |
| 189 | .len = ARRAY_SIZE(ptp_filter), .filter = ptp_filter, | 189 | |
| 190 | }; | 190 | ptp_prog.len = ARRAY_SIZE(ptp_filter); |
| 191 | ptp_prog.filter = ptp_filter; | ||
| 191 | 192 | ||
| 192 | BUG_ON(bpf_prog_create(&ptp_insns, &ptp_prog)); | 193 | BUG_ON(bpf_prog_create(&ptp_insns, &ptp_prog)); |
| 193 | } | 194 | } |
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index f9b964fd4e4d..5fa5bf3e9945 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
| @@ -4951,7 +4951,7 @@ static int rtnl_valid_stats_req(const struct nlmsghdr *nlh, bool strict_check, | |||
| 4951 | { | 4951 | { |
| 4952 | struct if_stats_msg *ifsm; | 4952 | struct if_stats_msg *ifsm; |
| 4953 | 4953 | ||
| 4954 | if (nlh->nlmsg_len < sizeof(*ifsm)) { | 4954 | if (nlh->nlmsg_len < nlmsg_msg_size(sizeof(*ifsm))) { |
| 4955 | NL_SET_ERR_MSG(extack, "Invalid header for stats dump"); | 4955 | NL_SET_ERR_MSG(extack, "Invalid header for stats dump"); |
| 4956 | return -EINVAL; | 4956 | return -EINVAL; |
| 4957 | } | 4957 | } |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 9901f5322852..a083e188374f 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
| @@ -5082,7 +5082,8 @@ EXPORT_SYMBOL_GPL(skb_gso_validate_mac_len); | |||
| 5082 | 5082 | ||
| 5083 | static struct sk_buff *skb_reorder_vlan_header(struct sk_buff *skb) | 5083 | static struct sk_buff *skb_reorder_vlan_header(struct sk_buff *skb) |
| 5084 | { | 5084 | { |
| 5085 | int mac_len; | 5085 | int mac_len, meta_len; |
| 5086 | void *meta; | ||
| 5086 | 5087 | ||
| 5087 | if (skb_cow(skb, skb_headroom(skb)) < 0) { | 5088 | if (skb_cow(skb, skb_headroom(skb)) < 0) { |
| 5088 | kfree_skb(skb); | 5089 | kfree_skb(skb); |
| @@ -5094,6 +5095,13 @@ static struct sk_buff *skb_reorder_vlan_header(struct sk_buff *skb) | |||
| 5094 | memmove(skb_mac_header(skb) + VLAN_HLEN, skb_mac_header(skb), | 5095 | memmove(skb_mac_header(skb) + VLAN_HLEN, skb_mac_header(skb), |
| 5095 | mac_len - VLAN_HLEN - ETH_TLEN); | 5096 | mac_len - VLAN_HLEN - ETH_TLEN); |
| 5096 | } | 5097 | } |
| 5098 | |||
| 5099 | meta_len = skb_metadata_len(skb); | ||
| 5100 | if (meta_len) { | ||
| 5101 | meta = skb_metadata_end(skb) - meta_len; | ||
| 5102 | memmove(meta + VLAN_HLEN, meta, meta_len); | ||
| 5103 | } | ||
| 5104 | |||
| 5097 | skb->mac_header += VLAN_HLEN; | 5105 | skb->mac_header += VLAN_HLEN; |
| 5098 | return skb; | 5106 | return skb; |
| 5099 | } | 5107 | } |
diff --git a/net/core/sock.c b/net/core/sock.c index 782343bb925b..067878a1e4c5 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
| @@ -348,7 +348,7 @@ static int sock_get_timeout(long timeo, void *optval, bool old_timeval) | |||
| 348 | tv.tv_usec = ((timeo % HZ) * USEC_PER_SEC) / HZ; | 348 | tv.tv_usec = ((timeo % HZ) * USEC_PER_SEC) / HZ; |
| 349 | } | 349 | } |
| 350 | 350 | ||
| 351 | if (in_compat_syscall() && !COMPAT_USE_64BIT_TIME) { | 351 | if (old_timeval && in_compat_syscall() && !COMPAT_USE_64BIT_TIME) { |
| 352 | struct old_timeval32 tv32 = { tv.tv_sec, tv.tv_usec }; | 352 | struct old_timeval32 tv32 = { tv.tv_sec, tv.tv_usec }; |
| 353 | *(struct old_timeval32 *)optval = tv32; | 353 | *(struct old_timeval32 *)optval = tv32; |
| 354 | return sizeof(tv32); | 354 | return sizeof(tv32); |
| @@ -372,7 +372,7 @@ static int sock_set_timeout(long *timeo_p, char __user *optval, int optlen, bool | |||
| 372 | { | 372 | { |
| 373 | struct __kernel_sock_timeval tv; | 373 | struct __kernel_sock_timeval tv; |
| 374 | 374 | ||
| 375 | if (in_compat_syscall() && !COMPAT_USE_64BIT_TIME) { | 375 | if (old_timeval && in_compat_syscall() && !COMPAT_USE_64BIT_TIME) { |
| 376 | struct old_timeval32 tv32; | 376 | struct old_timeval32 tv32; |
| 377 | 377 | ||
| 378 | if (optlen < sizeof(tv32)) | 378 | if (optlen < sizeof(tv32)) |
