]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 9 Jan 2022 13:07:16 +0000 (14:07 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 9 Jan 2022 13:07:16 +0000 (14:07 +0100)
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

queue-4.4/phonet-refcount-leak-in-pep_sock_accep.patch [new file with mode: 0644]
queue-4.4/rndis_host-support-hytera-digital-radios.patch [new file with mode: 0644]
queue-4.4/series
queue-4.4/xfs-map-unwritten-blocks-in-xfs_ioc_-alloc-free-sp-just-like-fallocate.patch [new file with mode: 0644]

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 (file)
index 0000000..84d2eed
--- /dev/null
@@ -0,0 +1,31 @@
+From bcd0f93353326954817a4f9fa55ec57fb38acbb0 Mon Sep 17 00:00:00 2001
+From: Hangyu Hua <hbh25y@gmail.com>
+Date: Thu, 9 Dec 2021 16:28:39 +0800
+Subject: phonet: refcount leak in pep_sock_accep
+
+From: Hangyu Hua <hbh25y@gmail.com>
+
+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 <hbh25y@gmail.com>
+Link: https://lore.kernel.org/r/20211209082839.33985-1-hbh25y@gmail.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Aayush Agarwal <aayush.a.agarwal@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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 (file)
index 0000000..cf396bc
--- /dev/null
@@ -0,0 +1,51 @@
+From 29262e1f773b4b6a43711120be564c57fca07cfb Mon Sep 17 00:00:00 2001
+From: Thomas Toye <thomas@toye.io>
+Date: Sat, 1 Jan 2022 18:22:07 +0100
+Subject: rndis_host: support Hytera digital radios
+
+From: Thomas Toye <thomas@toye.io>
+
+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 <thomas@toye.io>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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,
index 0190ce0ad749a00aaa4f64d0e4317a34c74e54fe..9cb482d173f3985d30412c7998d63ed8fac193e0 100644 (file)
@@ -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 (file)
index 0000000..7cd3bee
--- /dev/null
@@ -0,0 +1,35 @@
+From 983d8e60f50806f90534cc5373d0ce867e5aaf79 Mon Sep 17 00:00:00 2001
+From: "Darrick J. Wong" <djwong@kernel.org>
+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 <djwong@kernel.org>
+
+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 <ktkhai@virtuozzo.com>
+Signed-off-by: Darrick J. Wong <djwong@kernel.org>
+Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
+Reviewed-by: Dave Chinner <dchinner@redhat.com>
+Reviewed-by: Eric Sandeen <sandeen@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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;
+               }