From 7ae8e07ff4e9a0d51d5683ac1ad1285c002c683a Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 9 Jan 2022 14:07:16 +0100 Subject: [PATCH] 4.4-stable patches added patches: phonet-refcount-leak-in-pep_sock_accep.patch rndis_host-support-hytera-digital-radios.patch xfs-map-unwritten-blocks-in-xfs_ioc_-alloc-free-sp-just-like-fallocate.patch --- ...onet-refcount-leak-in-pep_sock_accep.patch | 31 +++++++++++ ...s_host-support-hytera-digital-radios.patch | 51 +++++++++++++++++++ queue-4.4/series | 3 ++ ...c_-alloc-free-sp-just-like-fallocate.patch | 35 +++++++++++++ 4 files changed, 120 insertions(+) create mode 100644 queue-4.4/phonet-refcount-leak-in-pep_sock_accep.patch create mode 100644 queue-4.4/rndis_host-support-hytera-digital-radios.patch create mode 100644 queue-4.4/xfs-map-unwritten-blocks-in-xfs_ioc_-alloc-free-sp-just-like-fallocate.patch diff --git a/queue-4.4/phonet-refcount-leak-in-pep_sock_accep.patch b/queue-4.4/phonet-refcount-leak-in-pep_sock_accep.patch new file mode 100644 index 00000000000..84d2eedd699 --- /dev/null +++ b/queue-4.4/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 +@@ -878,6 +878,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.4/rndis_host-support-hytera-digital-radios.patch b/queue-4.4/rndis_host-support-hytera-digital-radios.patch new file mode 100644 index 00000000000..cf396bc5ccd --- /dev/null +++ b/queue-4.4/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 +@@ -616,6 +616,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.4/series b/queue-4.4/series index 0190ce0ad74..9cb482d173f 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -4,3 +4,6 @@ ieee802154-atusb-fix-uninit-value-in-atusb_set_extended_addr.patch mac80211-initialize-variable-have_higher_than_11mbit.patch i40e-fix-incorrect-netdev-s-real-number-of-rx-tx-queues.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 +rndis_host-support-hytera-digital-radios.patch +phonet-refcount-leak-in-pep_sock_accep.patch diff --git a/queue-4.4/xfs-map-unwritten-blocks-in-xfs_ioc_-alloc-free-sp-just-like-fallocate.patch b/queue-4.4/xfs-map-unwritten-blocks-in-xfs_ioc_-alloc-free-sp-just-like-fallocate.patch new file mode 100644 index 00000000000..7cd3bee893d --- /dev/null +++ b/queue-4.4/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 +@@ -729,7 +729,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; + } -- 2.47.2