Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…git/stable/linux

Linux 4.19.310
  • Loading branch information
Rohail33 authored and raystef66 committed Mar 28, 2024
1 parent d10c017 commit d0563a0
Show file tree
Hide file tree
Showing 27 changed files with 989 additions and 373 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 4
PATCHLEVEL = 19
SUBLEVEL = 309
SUBLEVEL = 310
EXTRAVERSION =
NAME = "People's Front"

Expand Down
2 changes: 1 addition & 1 deletion arch/alpha/kernel/osf_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ put_tv32(struct timeval32 __user *o, struct timespec64 *i)
}

static inline long
put_tv_to_tv32(struct timeval32 __user *o, struct timeval *i)
put_tv_to_tv32(struct timeval32 __user *o, struct __kernel_old_timeval *i)
{
return copy_to_user(o, &(struct timeval32){
.tv_sec = i->tv_sec,
Expand Down
13 changes: 13 additions & 0 deletions arch/um/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,19 @@ config LD_SCRIPT_DYN
depends on !LD_SCRIPT_STATIC
select MODULE_REL_CRCS if MODVERSIONS

config LD_SCRIPT_DYN_RPATH
bool "set rpath in the binary" if EXPERT
default y
depends on LD_SCRIPT_DYN
help
Add /lib (and /lib64 for 64-bit) to the linux binary's rpath
explicitly.

You may need to turn this off if compiling for nix systems
that have their libraries in random /nix directories and
might otherwise unexpected use libraries from /lib or /lib64
instead of the desired ones.

config HOSTFS
tristate "Host filesystem"
help
Expand Down
3 changes: 2 additions & 1 deletion arch/um/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ archheaders:
archprepare: include/generated/user_constants.h

LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static
LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib $(call cc-option, -no-pie)
LINK-$(CONFIG_LD_SCRIPT_DYN) += $(call cc-option, -no-pie)
LINK-$(CONFIG_LD_SCRIPT_DYN_RPATH) += -Wl,-rpath,/lib

CFLAGS_NO_HARDENING := $(call cc-option, -fno-PIC,) $(call cc-option, -fno-pic,) \
$(call cc-option, -fno-stack-protector,) \
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/Makefile.um
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ ELF_FORMAT := elf64-x86-64

# Not on all 64-bit distros /lib is a symlink to /lib64. PLD is an example.

LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib64
LINK-$(CONFIG_LD_SCRIPT_DYN_RPATH) += -Wl,-rpath,/lib64
LINK-y += -m64

# Do unit-at-a-time unconditionally on x86_64, following the host
Expand Down
6 changes: 6 additions & 0 deletions drivers/input/serio/i8042-x86ia64io.h
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,12 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOLOOP |
SERIO_QUIRK_NOPNP)
},
{
.matches = {
DMI_MATCH(DMI_BOARD_NAME, "NS5x_7xPU"),
},
.driver_data = (void *)(SERIO_QUIRK_NOAUX)
},
{
.matches = {
DMI_MATCH(DMI_BOARD_NAME, "NJ50_70CU"),
Expand Down
18 changes: 16 additions & 2 deletions drivers/net/geneve.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ static void geneve_rx(struct geneve_dev *geneve, struct geneve_sock *gs,
struct metadata_dst *tun_dst = NULL;
struct pcpu_sw_netstats *stats;
unsigned int len;
int err = 0;
int nh, err = 0;
void *oiph;

if (ip_tunnel_collect_metadata() || gs->collect_md) {
Expand Down Expand Up @@ -261,9 +261,23 @@ static void geneve_rx(struct geneve_dev *geneve, struct geneve_sock *gs,
goto drop;
}

oiph = skb_network_header(skb);
/* Save offset of outer header relative to skb->head,
* because we are going to reset the network header to the inner header
* and might change skb->head.
*/
nh = skb_network_header(skb) - skb->head;

skb_reset_network_header(skb);

if (!pskb_inet_may_pull(skb)) {
DEV_STATS_INC(geneve->dev, rx_length_errors);
DEV_STATS_INC(geneve->dev, rx_errors);
goto drop;
}

/* Get the outer header. */
oiph = skb->head + nh;

if (geneve_get_sk_family(gs) == AF_INET)
err = IP_ECN_decapsulate(oiph, skb);
#if IS_ENABLED(CONFIG_IPV6)
Expand Down
96 changes: 73 additions & 23 deletions drivers/net/hyperv/netvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
#define LINKCHANGE_INT (2 * HZ)
#define VF_TAKEOVER_INT (HZ / 10)

/* Macros to define the context of vf registration */
#define VF_REG_IN_PROBE 1
#define VF_REG_IN_NOTIFIER 2

static unsigned int ring_size __ro_after_init = 128;
module_param(ring_size, uint, 0444);
MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)");
Expand Down Expand Up @@ -2025,7 +2029,7 @@ static rx_handler_result_t netvsc_vf_handle_frame(struct sk_buff **pskb)
}

static int netvsc_vf_join(struct net_device *vf_netdev,
struct net_device *ndev)
struct net_device *ndev, int context)
{
struct net_device_context *ndev_ctx = netdev_priv(ndev);
int ret;
Expand All @@ -2048,7 +2052,11 @@ static int netvsc_vf_join(struct net_device *vf_netdev,
goto upper_link_failed;
}

schedule_delayed_work(&ndev_ctx->vf_takeover, VF_TAKEOVER_INT);
/* If this registration is called from probe context vf_takeover
* is taken care of later in probe itself.
*/
if (context == VF_REG_IN_NOTIFIER)
schedule_delayed_work(&ndev_ctx->vf_takeover, VF_TAKEOVER_INT);

call_netdevice_notifiers(NETDEV_JOIN, vf_netdev);

Expand Down Expand Up @@ -2141,8 +2149,17 @@ static struct net_device *get_netvsc_byslot(const struct net_device *vf_netdev)
if (!ndev_ctx->vf_alloc)
continue;

if (ndev_ctx->vf_serial == serial)
return hv_get_drvdata(ndev_ctx->device_ctx);
if (ndev_ctx->vf_serial != serial)
continue;

ndev = hv_get_drvdata(ndev_ctx->device_ctx);
if (ndev->addr_len != vf_netdev->addr_len ||
memcmp(ndev->perm_addr, vf_netdev->perm_addr,
ndev->addr_len) != 0)
continue;

return ndev;

}

/* Fallback path to check synthetic vf with help of mac addr.
Expand Down Expand Up @@ -2177,7 +2194,7 @@ static int netvsc_prepare_bonding(struct net_device *vf_netdev)
return NOTIFY_DONE;
}

static int netvsc_register_vf(struct net_device *vf_netdev)
static int netvsc_register_vf(struct net_device *vf_netdev, int context)
{
struct net_device_context *net_device_ctx;
struct netvsc_device *netvsc_dev;
Expand Down Expand Up @@ -2216,7 +2233,7 @@ static int netvsc_register_vf(struct net_device *vf_netdev)

netdev_info(ndev, "VF registering: %s\n", vf_netdev->name);

if (netvsc_vf_join(vf_netdev, ndev) != 0)
if (netvsc_vf_join(vf_netdev, ndev, context) != 0)
return NOTIFY_DONE;

dev_hold(vf_netdev);
Expand Down Expand Up @@ -2276,10 +2293,31 @@ static int netvsc_unregister_vf(struct net_device *vf_netdev)
return NOTIFY_OK;
}

static int check_dev_is_matching_vf(struct net_device *event_ndev)
{
/* Skip NetVSC interfaces */
if (event_ndev->netdev_ops == &device_ops)
return -ENODEV;

/* Avoid non-Ethernet type devices */
if (event_ndev->type != ARPHRD_ETHER)
return -ENODEV;

/* Avoid Vlan dev with same MAC registering as VF */
if (is_vlan_dev(event_ndev))
return -ENODEV;

/* Avoid Bonding master dev with same MAC registering as VF */
if (netif_is_bond_master(event_ndev))
return -ENODEV;

return 0;
}

static int netvsc_probe(struct hv_device *dev,
const struct hv_vmbus_device_id *dev_id)
{
struct net_device *net = NULL;
struct net_device *net = NULL, *vf_netdev;
struct net_device_context *net_device_ctx;
struct netvsc_device_info *device_info = NULL;
struct netvsc_device *nvdev;
Expand Down Expand Up @@ -2382,6 +2420,30 @@ static int netvsc_probe(struct hv_device *dev,
}

list_add(&net_device_ctx->list, &netvsc_dev_list);

/* When the hv_netvsc driver is unloaded and reloaded, the
* NET_DEVICE_REGISTER for the vf device is replayed before probe
* is complete. This is because register_netdevice_notifier() gets
* registered before vmbus_driver_register() so that callback func
* is set before probe and we don't miss events like NETDEV_POST_INIT
* So, in this section we try to register the matching vf device that
* is present as a netdevice, knowing that its register call is not
* processed in the netvsc_netdev_notifier(as probing is progress and
* get_netvsc_byslot fails).
*/
for_each_netdev(dev_net(net), vf_netdev) {
ret = check_dev_is_matching_vf(vf_netdev);
if (ret != 0)
continue;

if (net != get_netvsc_byslot(vf_netdev))
continue;

netvsc_prepare_bonding(vf_netdev);
netvsc_register_vf(vf_netdev, VF_REG_IN_PROBE);
__netvsc_vf_setup(net, vf_netdev);
break;
}
rtnl_unlock();

kfree(device_info);
Expand Down Expand Up @@ -2474,29 +2536,17 @@ static int netvsc_netdev_event(struct notifier_block *this,
unsigned long event, void *ptr)
{
struct net_device *event_dev = netdev_notifier_info_to_dev(ptr);
int ret = 0;

/* Skip our own events */
if (event_dev->netdev_ops == &device_ops)
return NOTIFY_DONE;

/* Avoid non-Ethernet type devices */
if (event_dev->type != ARPHRD_ETHER)
return NOTIFY_DONE;

/* Avoid Vlan dev with same MAC registering as VF */
if (is_vlan_dev(event_dev))
return NOTIFY_DONE;

/* Avoid Bonding master dev with same MAC registering as VF */
if ((event_dev->priv_flags & IFF_BONDING) &&
(event_dev->flags & IFF_MASTER))
ret = check_dev_is_matching_vf(event_dev);
if (ret != 0)
return NOTIFY_DONE;

switch (event) {
case NETDEV_POST_INIT:
return netvsc_prepare_bonding(event_dev);
case NETDEV_REGISTER:
return netvsc_register_vf(event_dev);
return netvsc_register_vf(event_dev, VF_REG_IN_NOTIFIER);
case NETDEV_UNREGISTER:
return netvsc_unregister_vf(event_dev);
case NETDEV_UP:
Expand Down
6 changes: 0 additions & 6 deletions drivers/net/loopback.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@
#include <net/net_namespace.h>
#include <linux/u64_stats_sync.h>

struct pcpu_lstats {
u64 packets;
u64 bytes;
struct u64_stats_sync syncp;
};

/* The higher levels take care of making this non-reentrant (it's
* called with bh's disabled).
*/
Expand Down
6 changes: 0 additions & 6 deletions drivers/net/nlmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
#include <linux/if_arp.h>
#include <net/rtnetlink.h>

struct pcpu_lstats {
u64 packets;
u64 bytes;
struct u64_stats_sync syncp;
};

static netdev_tx_t nlmon_xmit(struct sk_buff *skb, struct net_device *dev)
{
int len = skb->len;
Expand Down
Loading

0 comments on commit d0563a0

Please sign in to comment.