diff options
author | Björn Bidar | 2022-06-24 20:03:01 +0300 |
---|---|---|
committer | Björn Bidar | 2022-06-25 16:46:45 +0300 |
commit | 657059c03d46120dea746abb196d9d622e21fe5f (patch) | |
tree | 2ae07d28cd858ef0cda12e3c8af27932d06c0fbb /0111-usb-gadget-u_ether-fix-regression-in-setting-fixed-M.patch | |
parent | 034adcf2fd3311bba3f58b8575b0be699ab3bd70 (diff) | |
download | aur-657059c03d46120dea746abb196d9d622e21fe5f.tar.gz |
Update to 5.18.6.p2-1
- New upstream release based on 5.18.5
- Add MGLRU Zen patch
- Add linux-5.18.6 patches
- Move System.map from -headers into the base package to avoid
external modules having wrong bpf symbols when running optimized
builds. Fixes #5
- Remove M/m from CPUSUFFIXES_KBUILD and LCPU, fixes build failing
when selecting an optimized build architecture that is not genering.
Fixes #6.
Signed-off-by: Björn Bidar <bjorn.bidar@thaodan.de>
Diffstat (limited to '0111-usb-gadget-u_ether-fix-regression-in-setting-fixed-M.patch')
-rw-r--r-- | 0111-usb-gadget-u_ether-fix-regression-in-setting-fixed-M.patch | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/0111-usb-gadget-u_ether-fix-regression-in-setting-fixed-M.patch b/0111-usb-gadget-u_ether-fix-regression-in-setting-fixed-M.patch new file mode 100644 index 000000000000..956e6081a7a3 --- /dev/null +++ b/0111-usb-gadget-u_ether-fix-regression-in-setting-fixed-M.patch @@ -0,0 +1,81 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Marian Postevca <posteuca@mutex.one> +Date: Fri, 3 Jun 2022 18:34:59 +0300 +Subject: [PATCH] usb: gadget: u_ether: fix regression in setting fixed MAC + address + +commit b337af3a4d6147000b7ca6b3438bf5c820849b37 upstream. + +In systemd systems setting a fixed MAC address through +the "dev_addr" module argument fails systematically. +When checking the MAC address after the interface is created +it always has the same but different MAC address to the one +supplied as argument. + +This is partially caused by systemd which by default will +set an internally generated permanent MAC address for interfaces +that are marked as having a randomly generated address. + +Commit 890d5b40908bfd1a ("usb: gadget: u_ether: fix race in +setting MAC address in setup phase") didn't take into account +the fact that the interface must be marked as having a set +MAC address when it's set as module argument. + +Fixed by marking the interface with NET_ADDR_SET when +the "dev_addr" module argument is supplied. + +Fixes: 890d5b40908bfd1a ("usb: gadget: u_ether: fix race in setting MAC address in setup phase") +Cc: stable@vger.kernel.org +Signed-off-by: Marian Postevca <posteuca@mutex.one> +Link: https://lore.kernel.org/r/20220603153459.32722-1-posteuca@mutex.one +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + drivers/usb/gadget/function/u_ether.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c +index 6f5d45ef2e39a8caeab230cd42111477e387195a..f51694f29de92bb3d882d75d8c845ea42117aa3f 100644 +--- a/drivers/usb/gadget/function/u_ether.c ++++ b/drivers/usb/gadget/function/u_ether.c +@@ -775,9 +775,13 @@ struct eth_dev *gether_setup_name(struct usb_gadget *g, + dev->qmult = qmult; + snprintf(net->name, sizeof(net->name), "%s%%d", netname); + +- if (get_ether_addr(dev_addr, addr)) ++ if (get_ether_addr(dev_addr, addr)) { ++ net->addr_assign_type = NET_ADDR_RANDOM; + dev_warn(&g->dev, + "using random %s ethernet address\n", "self"); ++ } else { ++ net->addr_assign_type = NET_ADDR_SET; ++ } + eth_hw_addr_set(net, addr); + if (get_ether_addr(host_addr, dev->host_mac)) + dev_warn(&g->dev, +@@ -844,6 +848,10 @@ struct net_device *gether_setup_name_default(const char *netname) + + eth_random_addr(dev->dev_mac); + pr_warn("using random %s ethernet address\n", "self"); ++ ++ /* by default we always have a random MAC address */ ++ net->addr_assign_type = NET_ADDR_RANDOM; ++ + eth_random_addr(dev->host_mac); + pr_warn("using random %s ethernet address\n", "host"); + +@@ -871,7 +879,6 @@ int gether_register_netdev(struct net_device *net) + dev = netdev_priv(net); + g = dev->gadget; + +- net->addr_assign_type = NET_ADDR_RANDOM; + eth_hw_addr_set(net, dev->dev_mac); + + status = register_netdev(net); +@@ -912,6 +919,7 @@ int gether_set_dev_addr(struct net_device *net, const char *dev_addr) + if (get_ether_addr(dev_addr, new_addr)) + return -EINVAL; + memcpy(dev->dev_mac, new_addr, ETH_ALEN); ++ net->addr_assign_type = NET_ADDR_SET; + return 0; + } + EXPORT_SYMBOL_GPL(gether_set_dev_addr); |