From: Greg Kroah-Hartman Date: Sun, 9 Jan 2022 13:07:55 +0000 (+0100) Subject: 4.14-stable patches X-Git-Tag: v4.4.299~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=732baf035334033dafd580dc68d2544f3562588f;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: phonet-refcount-leak-in-pep_sock_accep.patch power-reset-ltc2952-fix-use-of-floating-point-literals.patch rndis_host-support-hytera-digital-radios.patch xfs-map-unwritten-blocks-in-xfs_ioc_-alloc-free-sp-just-like-fallocate.patch --- diff --git a/queue-4.14/phonet-refcount-leak-in-pep_sock_accep.patch b/queue-4.14/phonet-refcount-leak-in-pep_sock_accep.patch new file mode 100644 index 00000000000..fe68b120009 --- /dev/null +++ b/queue-4.14/phonet-refcount-leak-in-pep_sock_accep.patch @@ -0,0 +1,31 @@ +From bcd0f93353326954817a4f9fa55ec57fb38acbb0 Mon Sep 17 00:00:00 2001 +From: Hangyu Hua +Date: Thu, 9 Dec 2021 16:28:39 +0800 +Subject: phonet: refcount leak in pep_sock_accep + +From: Hangyu Hua + +commit bcd0f93353326954817a4f9fa55ec57fb38acbb0 upstream. + +sock_hold(sk) is invoked in pep_sock_accept(), but __sock_put(sk) is not +invoked in subsequent failure branches(pep_accept_conn() != 0). + +Signed-off-by: Hangyu Hua +Link: https://lore.kernel.org/r/20211209082839.33985-1-hbh25y@gmail.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Aayush Agarwal +Signed-off-by: Greg Kroah-Hartman +--- + net/phonet/pep.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/net/phonet/pep.c ++++ b/net/phonet/pep.c +@@ -881,6 +881,7 @@ static struct sock *pep_sock_accept(stru + + err = pep_accept_conn(newsk, skb); + if (err) { ++ __sock_put(sk); + sock_put(newsk); + newsk = NULL; + goto drop; diff --git a/queue-4.14/power-reset-ltc2952-fix-use-of-floating-point-literals.patch b/queue-4.14/power-reset-ltc2952-fix-use-of-floating-point-literals.patch new file mode 100644 index 00000000000..67f8aef1543 --- /dev/null +++ b/queue-4.14/power-reset-ltc2952-fix-use-of-floating-point-literals.patch @@ -0,0 +1,58 @@ +From 644106cdb89844be2496b21175b7c0c2e0fab381 Mon Sep 17 00:00:00 2001 +From: Nathan Chancellor +Date: Fri, 5 Nov 2021 08:20:50 -0700 +Subject: power: reset: ltc2952: Fix use of floating point literals + +From: Nathan Chancellor + +commit 644106cdb89844be2496b21175b7c0c2e0fab381 upstream. + +A new commit in LLVM causes an error on the use of 'long double' when +'-mno-x87' is used, which the kernel does through an alias, +'-mno-80387' (see the LLVM commit below for more details around why it +does this). + +drivers/power/reset/ltc2952-poweroff.c:162:28: error: expression requires 'long double' type support, but target 'x86_64-unknown-linux-gnu' does not support it + data->wde_interval = 300L * 1E6L; + ^ +drivers/power/reset/ltc2952-poweroff.c:162:21: error: expression requires 'long double' type support, but target 'x86_64-unknown-linux-gnu' does not support it + data->wde_interval = 300L * 1E6L; + ^ +drivers/power/reset/ltc2952-poweroff.c:163:41: error: expression requires 'long double' type support, but target 'x86_64-unknown-linux-gnu' does not support it + data->trigger_delay = ktime_set(2, 500L*1E6L); + ^ +3 errors generated. + +This happens due to the use of a 'long double' literal. The 'E6' part of +'1E6L' causes the literal to be a 'double' then the 'L' suffix promotes +it to 'long double'. + +There is no visible reason for floating point values in this driver, as +the values are only assigned to integer types. Use NSEC_PER_MSEC, which +is the same integer value as '1E6L', to avoid changing functionality but +fix the error. + +Fixes: 6647156c00cc ("power: reset: add LTC2952 poweroff driver") +Link: https://github.com/ClangBuiltLinux/linux/issues/1497 +Link: https://github.com/llvm/llvm-project/commit/a8083d42b1c346e21623a1d36d1f0cadd7801d83 +Signed-off-by: Nathan Chancellor +Reviewed-by: Nick Desaulniers +Signed-off-by: Sebastian Reichel +Signed-off-by: Greg Kroah-Hartman +--- + drivers/power/reset/ltc2952-poweroff.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/power/reset/ltc2952-poweroff.c ++++ b/drivers/power/reset/ltc2952-poweroff.c +@@ -169,8 +169,8 @@ static void ltc2952_poweroff_kill(void) + + static void ltc2952_poweroff_default(struct ltc2952_poweroff *data) + { +- data->wde_interval = 300L * 1E6L; +- data->trigger_delay = ktime_set(2, 500L*1E6L); ++ data->wde_interval = 300L * NSEC_PER_MSEC; ++ data->trigger_delay = ktime_set(2, 500L * NSEC_PER_MSEC); + + hrtimer_init(&data->timer_trigger, CLOCK_MONOTONIC, HRTIMER_MODE_REL); + data->timer_trigger.function = ltc2952_poweroff_timer_trigger; diff --git a/queue-4.14/rndis_host-support-hytera-digital-radios.patch b/queue-4.14/rndis_host-support-hytera-digital-radios.patch new file mode 100644 index 00000000000..7b4ddab2f35 --- /dev/null +++ b/queue-4.14/rndis_host-support-hytera-digital-radios.patch @@ -0,0 +1,51 @@ +From 29262e1f773b4b6a43711120be564c57fca07cfb Mon Sep 17 00:00:00 2001 +From: Thomas Toye +Date: Sat, 1 Jan 2022 18:22:07 +0100 +Subject: rndis_host: support Hytera digital radios + +From: Thomas Toye + +commit 29262e1f773b4b6a43711120be564c57fca07cfb upstream. + +Hytera makes a range of digital (DMR) radios. These radios can be +programmed to a allow a computer to control them over Ethernet over USB, +either using NCM or RNDIS. + +This commit adds support for RNDIS for Hytera radios. I tested with a +Hytera PD785 and a Hytera MD785G. When these radios are programmed to +set up a Radio to PC Network using RNDIS, an USB interface will be added +with class 2 (Communications), subclass 2 (Abstract Modem Control) and +an interface protocol of 255 ("vendor specific" - lsusb even hints "MSFT +RNDIS?"). + +This patch is similar to the solution of this StackOverflow user, but +that only works for the Hytera MD785: +https://stackoverflow.com/a/53550858 + +To use the "Radio to PC Network" functionality of Hytera DMR radios, the +radios need to be programmed correctly in CPS (Hytera's Customer +Programming Software). "Forward to PC" should be checked in "Network" +(under "General Setting" in "Conventional") and the "USB Network +Communication Protocol" should be set to RNDIS. + +Signed-off-by: Thomas Toye +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/usb/rndis_host.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/net/usb/rndis_host.c ++++ b/drivers/net/usb/rndis_host.c +@@ -621,6 +621,11 @@ static const struct usb_device_id produc + USB_CLASS_COMM, 2 /* ACM */, 0x0ff), + .driver_info = (unsigned long) &rndis_poll_status_info, + }, { ++ /* Hytera Communications DMR radios' "Radio to PC Network" */ ++ USB_VENDOR_AND_INTERFACE_INFO(0x238b, ++ USB_CLASS_COMM, 2 /* ACM */, 0x0ff), ++ .driver_info = (unsigned long)&rndis_info, ++}, { + /* RNDIS is MSFT's un-official variant of CDC ACM */ + USB_INTERFACE_INFO(USB_CLASS_COMM, 2 /* ACM */, 0x0ff), + .driver_info = (unsigned long) &rndis_info, diff --git a/queue-4.14/series b/queue-4.14/series index c16b48512a7..ee70c7a74db 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -10,3 +10,7 @@ i40e-fix-incorrect-netdev-s-real-number-of-rx-tx-queues.patch ipv6-check-attribute-length-for-rta_gateway-in-multipath-route.patch ipv6-check-attribute-length-for-rta_gateway-when-deleting-multipath-route.patch sch_qfq-prevent-shift-out-of-bounds-in-qfq_init_qdisc.patch +xfs-map-unwritten-blocks-in-xfs_ioc_-alloc-free-sp-just-like-fallocate.patch +power-reset-ltc2952-fix-use-of-floating-point-literals.patch +rndis_host-support-hytera-digital-radios.patch +phonet-refcount-leak-in-pep_sock_accep.patch diff --git a/queue-4.14/xfs-map-unwritten-blocks-in-xfs_ioc_-alloc-free-sp-just-like-fallocate.patch b/queue-4.14/xfs-map-unwritten-blocks-in-xfs_ioc_-alloc-free-sp-just-like-fallocate.patch new file mode 100644 index 00000000000..5a2e0170d17 --- /dev/null +++ b/queue-4.14/xfs-map-unwritten-blocks-in-xfs_ioc_-alloc-free-sp-just-like-fallocate.patch @@ -0,0 +1,35 @@ +From 983d8e60f50806f90534cc5373d0ce867e5aaf79 Mon Sep 17 00:00:00 2001 +From: "Darrick J. Wong" +Date: Wed, 22 Dec 2021 14:19:18 -0800 +Subject: xfs: map unwritten blocks in XFS_IOC_{ALLOC,FREE}SP just like fallocate + +From: Darrick J. Wong + +commit 983d8e60f50806f90534cc5373d0ce867e5aaf79 upstream. + +The old ALLOCSP/FREESP ioctls in XFS can be used to preallocate space at +the end of files, just like fallocate and RESVSP. Make the behavior +consistent with the other ioctls. + +Reported-by: Kirill Tkhai +Signed-off-by: Darrick J. Wong +Signed-off-by: Darrick J. Wong +Reviewed-by: Dave Chinner +Reviewed-by: Eric Sandeen +Signed-off-by: Greg Kroah-Hartman +--- + fs/xfs/xfs_ioctl.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/fs/xfs/xfs_ioctl.c ++++ b/fs/xfs/xfs_ioctl.c +@@ -715,7 +715,8 @@ xfs_ioc_space( + flags |= XFS_PREALLOC_CLEAR; + if (bf->l_start > XFS_ISIZE(ip)) { + error = xfs_alloc_file_space(ip, XFS_ISIZE(ip), +- bf->l_start - XFS_ISIZE(ip), 0); ++ bf->l_start - XFS_ISIZE(ip), ++ XFS_BMAPI_PREALLOC); + if (error) + goto out_unlock; + }