]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 30 Mar 2020 14:32:41 +0000 (16:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 30 Mar 2020 14:32:41 +0000 (16:32 +0200)
added patches:
arm-dts-sun8i-a83t-tbs-a711-fix-usb-otg-mode-detection.patch
bpf-btf-fix-btf-verification-of-enum-members-in-struct-union.patch
revert-r8169-check-that-realtek-phy-driver-module-is-loaded.patch
vti6-fix-memory-leak-of-skb-if-input-policy-check-fails.patch

queue-4.19/arm-dts-sun8i-a83t-tbs-a711-fix-usb-otg-mode-detection.patch [new file with mode: 0644]
queue-4.19/bpf-btf-fix-btf-verification-of-enum-members-in-struct-union.patch [new file with mode: 0644]
queue-4.19/revert-r8169-check-that-realtek-phy-driver-module-is-loaded.patch [new file with mode: 0644]
queue-4.19/series
queue-4.19/vti6-fix-memory-leak-of-skb-if-input-policy-check-fails.patch [new file with mode: 0644]

diff --git a/queue-4.19/arm-dts-sun8i-a83t-tbs-a711-fix-usb-otg-mode-detection.patch b/queue-4.19/arm-dts-sun8i-a83t-tbs-a711-fix-usb-otg-mode-detection.patch
new file mode 100644 (file)
index 0000000..e3cf572
--- /dev/null
@@ -0,0 +1,39 @@
+From b642d4825441bf30c72b72deb739bd2d5f53af08 Mon Sep 17 00:00:00 2001
+From: Ondrej Jirman <megous@megous.com>
+Date: Sat, 22 Feb 2020 23:31:53 +0100
+Subject: ARM: dts: sun8i-a83t-tbs-a711: Fix USB OTG mode detection
+
+From: Ondrej Jirman <megous@megous.com>
+
+commit b642d4825441bf30c72b72deb739bd2d5f53af08 upstream.
+
+USB-ID signal has a pullup on the schematic, but in reality it's not
+pulled up, so add a GPIO pullup. And we also need a usb0_vbus_power-supply
+for VBUS detection.
+
+This fixes OTG mode detection and charging issues on TBS A711 tablet.
+The issues came from ID pin reading 0, causing host mode to be enabled,
+when it should not be, leading to DRVVBUS being enabled, which disabled
+the charger.
+
+Fixes: f2f221c7810b824e ("ARM: dts: sun8i: a711: Enable USB OTG")
+Signed-off-by: Ondrej Jirman <megous@megous.com>
+Signed-off-by: Maxime Ripard <maxime@cerno.tech>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
++++ b/arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts
+@@ -416,7 +416,8 @@
+ };
+ &usbphy {
+-      usb0_id_det-gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */
++      usb0_id_det-gpios = <&pio 7 11 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PH11 */
++      usb0_vbus_power-supply = <&usb_power_supply>;
+       usb0_vbus-supply = <&reg_drivevbus>;
+       usb1_vbus_supply = <&reg_vmain>;
+       usb2_vbus_supply = <&reg_vmain>;
diff --git a/queue-4.19/bpf-btf-fix-btf-verification-of-enum-members-in-struct-union.patch b/queue-4.19/bpf-btf-fix-btf-verification-of-enum-members-in-struct-union.patch
new file mode 100644 (file)
index 0000000..64e34bf
--- /dev/null
@@ -0,0 +1,37 @@
+From da6c7faeb103c493e505e87643272f70be586635 Mon Sep 17 00:00:00 2001
+From: Yoshiki Komachi <komachi.yoshiki@gmail.com>
+Date: Tue, 10 Mar 2020 16:32:29 +0900
+Subject: bpf/btf: Fix BTF verification of enum members in struct/union
+
+From: Yoshiki Komachi <komachi.yoshiki@gmail.com>
+
+commit da6c7faeb103c493e505e87643272f70be586635 upstream.
+
+btf_enum_check_member() was currently sure to recognize the size of
+"enum" type members in struct/union as the size of "int" even if
+its size was packed.
+
+This patch fixes BTF enum verification to use the correct size
+of member in BPF programs.
+
+Fixes: 179cde8cef7e ("bpf: btf: Check members of struct/union")
+Signed-off-by: Yoshiki Komachi <komachi.yoshiki@gmail.com>
+Signed-off-by: Alexei Starovoitov <ast@kernel.org>
+Link: https://lore.kernel.org/bpf/1583825550-18606-2-git-send-email-komachi.yoshiki@gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/bpf/btf.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/kernel/bpf/btf.c
++++ b/kernel/bpf/btf.c
+@@ -1763,7 +1763,7 @@ static int btf_enum_check_member(struct
+       struct_size = struct_type->size;
+       bytes_offset = BITS_ROUNDDOWN_BYTES(struct_bits_off);
+-      if (struct_size - bytes_offset < sizeof(int)) {
++      if (struct_size - bytes_offset < member_type->size) {
+               btf_verifier_log_member(env, struct_type, member,
+                                       "Member exceeds struct_size");
+               return -EINVAL;
diff --git a/queue-4.19/revert-r8169-check-that-realtek-phy-driver-module-is-loaded.patch b/queue-4.19/revert-r8169-check-that-realtek-phy-driver-module-is-loaded.patch
new file mode 100644 (file)
index 0000000..f672aea
--- /dev/null
@@ -0,0 +1,41 @@
+From e413fffb6c72e4760156c1094f65c7d9456b7d1e Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Mon, 30 Mar 2020 16:28:20 +0200
+Subject: Revert "r8169: check that Realtek PHY driver module is loaded"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+This reverts commit 85a19b0e31e256e77fd4124804b9cec10619de5e which is
+commit f325937735498afb054a0195291bbf68d0b60be5 upstream.
+
+Heiner writes:
+       commit 85a19b0e31e2 ("r8169: check that Realtek PHY driver
+       module is loaded") made it accidentally to 4.19 and causes an
+       issue with Android/x86.  Could you please revert it?
+
+Cc: Heiner Kallweit <hkallweit1@gmail.com>
+Cc: David S. Miller <davem@davemloft.net>
+Cc: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/realtek/r8169.c |    9 ---------
+ 1 file changed, 9 deletions(-)
+
+--- a/drivers/net/ethernet/realtek/r8169.c
++++ b/drivers/net/ethernet/realtek/r8169.c
+@@ -7433,15 +7433,6 @@ static int rtl_init_one(struct pci_dev *
+       int chipset, region, i;
+       int jumbo_max, rc;
+-      /* Some tools for creating an initramfs don't consider softdeps, then
+-       * r8169.ko may be in initramfs, but realtek.ko not. Then the generic
+-       * PHY driver is used that doesn't work with most chip versions.
+-       */
+-      if (!driver_find("RTL8201CP Ethernet", &mdio_bus_type)) {
+-              dev_err(&pdev->dev, "realtek.ko not loaded, maybe it needs to be added to initramfs?\n");
+-              return -ENOENT;
+-      }
+-
+       dev = devm_alloc_etherdev(&pdev->dev, sizeof (*tp));
+       if (!dev)
+               return -ENOMEM;
index 0c81b2341fa71a92c84553c66d2c92242ea97f3d..6830cabba62e182cf3a94e1eeb960fa81b3d4a79 100644 (file)
@@ -72,3 +72,7 @@ afs-fix-some-tracing-details.patch
 netfilter-flowtable-reload-ip-v6-h-in-nf_flow_tuple_ip-v6.patch
 netfilter-nft_fwd_netdev-validate-family-and-chain-type.patch
 netfilter-nft_fwd_netdev-allow-to-redirect-to-ifb-via-ingress.patch
+bpf-btf-fix-btf-verification-of-enum-members-in-struct-union.patch
+arm-dts-sun8i-a83t-tbs-a711-fix-usb-otg-mode-detection.patch
+vti6-fix-memory-leak-of-skb-if-input-policy-check-fails.patch
+revert-r8169-check-that-realtek-phy-driver-module-is-loaded.patch
diff --git a/queue-4.19/vti6-fix-memory-leak-of-skb-if-input-policy-check-fails.patch b/queue-4.19/vti6-fix-memory-leak-of-skb-if-input-policy-check-fails.patch
new file mode 100644 (file)
index 0000000..8f4bfef
--- /dev/null
@@ -0,0 +1,39 @@
+From 2a9de3af21aa8c31cd68b0b39330d69f8c1e59df Mon Sep 17 00:00:00 2001
+From: Torsten Hilbrich <torsten.hilbrich@secunet.com>
+Date: Wed, 11 Mar 2020 11:19:06 +0100
+Subject: vti6: Fix memory leak of skb if input policy check fails
+
+From: Torsten Hilbrich <torsten.hilbrich@secunet.com>
+
+commit 2a9de3af21aa8c31cd68b0b39330d69f8c1e59df upstream.
+
+The vti6_rcv function performs some tests on the retrieved tunnel
+including checking the IP protocol, the XFRM input policy, the
+source and destination address.
+
+In all but one places the skb is released in the error case. When
+the input policy check fails the network packet is leaked.
+
+Using the same goto-label discard in this case to fix this problem.
+
+Fixes: ed1efb2aefbb ("ipv6: Add support for IPsec virtual tunnel interfaces")
+Signed-off-by: Torsten Hilbrich <torsten.hilbrich@secunet.com>
+Reviewed-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
+Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/ipv6/ip6_vti.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/net/ipv6/ip6_vti.c
++++ b/net/ipv6/ip6_vti.c
+@@ -315,7 +315,7 @@ static int vti6_rcv(struct sk_buff *skb)
+               if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) {
+                       rcu_read_unlock();
+-                      return 0;
++                      goto discard;
+               }
+               ipv6h = ipv6_hdr(skb);