]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.2-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Sep 2019 21:09:45 +0000 (23:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Sep 2019 21:09:45 +0000 (23:09 +0200)
added patches:
media-technisat-usb2-break-out-of-loop-at-end-of-buffer.patch
vfs-fix-refcounting-of-filenames-in-fs_parser.patch

queue-5.2/media-technisat-usb2-break-out-of-loop-at-end-of-buffer.patch [new file with mode: 0644]
queue-5.2/series
queue-5.2/vfs-fix-refcounting-of-filenames-in-fs_parser.patch [new file with mode: 0644]

diff --git a/queue-5.2/media-technisat-usb2-break-out-of-loop-at-end-of-buffer.patch b/queue-5.2/media-technisat-usb2-break-out-of-loop-at-end-of-buffer.patch
new file mode 100644 (file)
index 0000000..4d45702
--- /dev/null
@@ -0,0 +1,72 @@
+From 0c4df39e504bf925ab666132ac3c98d6cbbe380b Mon Sep 17 00:00:00 2001
+From: Sean Young <sean@mess.org>
+Date: Wed, 3 Jul 2019 10:52:39 -0400
+Subject: media: technisat-usb2: break out of loop at end of buffer
+
+From: Sean Young <sean@mess.org>
+
+commit 0c4df39e504bf925ab666132ac3c98d6cbbe380b upstream.
+
+Ensure we do not access the buffer beyond the end if no 0xff byte
+is encountered.
+
+Reported-by: syzbot+eaaaf38a95427be88f4b@syzkaller.appspotmail.com
+Signed-off-by: Sean Young <sean@mess.org>
+Reviewed-by: Kees Cook <keescook@chromium.org>
+Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/media/usb/dvb-usb/technisat-usb2.c |   22 ++++++++++------------
+ 1 file changed, 10 insertions(+), 12 deletions(-)
+
+--- a/drivers/media/usb/dvb-usb/technisat-usb2.c
++++ b/drivers/media/usb/dvb-usb/technisat-usb2.c
+@@ -608,10 +608,9 @@ static int technisat_usb2_frontend_attac
+ static int technisat_usb2_get_ir(struct dvb_usb_device *d)
+ {
+       struct technisat_usb2_state *state = d->priv;
+-      u8 *buf = state->buf;
+-      u8 *b;
+-      int ret;
+       struct ir_raw_event ev;
++      u8 *buf = state->buf;
++      int i, ret;
+       buf[0] = GET_IR_DATA_VENDOR_REQUEST;
+       buf[1] = 0x08;
+@@ -647,26 +646,25 @@ unlock:
+               return 0; /* no key pressed */
+       /* decoding */
+-      b = buf+1;
+ #if 0
+       deb_rc("RC: %d ", ret);
+-      debug_dump(b, ret, deb_rc);
++      debug_dump(buf + 1, ret, deb_rc);
+ #endif
+       ev.pulse = 0;
+-      while (1) {
+-              ev.pulse = !ev.pulse;
+-              ev.duration = (*b * FIRMWARE_CLOCK_DIVISOR * FIRMWARE_CLOCK_TICK) / 1000;
+-              ir_raw_event_store(d->rc_dev, &ev);
+-
+-              b++;
+-              if (*b == 0xff) {
++      for (i = 1; i < ARRAY_SIZE(state->buf); i++) {
++              if (buf[i] == 0xff) {
+                       ev.pulse = 0;
+                       ev.duration = 888888*2;
+                       ir_raw_event_store(d->rc_dev, &ev);
+                       break;
+               }
++
++              ev.pulse = !ev.pulse;
++              ev.duration = (buf[i] * FIRMWARE_CLOCK_DIVISOR *
++                             FIRMWARE_CLOCK_TICK) / 1000;
++              ir_raw_event_store(d->rc_dev, &ev);
+       }
+       ir_raw_event_handle(d->rc_dev);
index e956e8c70a1fb2de510766ae67808125a6cc2cf8..6838866001e24dea757bc0864dc8eabe86285782 100644 (file)
@@ -120,3 +120,5 @@ iommu-amd-fix-race-in-increase_address_space.patch
 revert-arm64-remove-unnecessary-isbs-from-set_-pte-pmd-pud.patch
 ovl-fix-regression-caused-by-overlapping-layers-detection.patch
 floppy-fix-usercopy-direction.patch
+media-technisat-usb2-break-out-of-loop-at-end-of-buffer.patch
+vfs-fix-refcounting-of-filenames-in-fs_parser.patch
diff --git a/queue-5.2/vfs-fix-refcounting-of-filenames-in-fs_parser.patch b/queue-5.2/vfs-fix-refcounting-of-filenames-in-fs_parser.patch
new file mode 100644 (file)
index 0000000..2ef3d6f
--- /dev/null
@@ -0,0 +1,31 @@
+From 7cdfa44227b0d8842d46a775cebe4311150cb8f2 Mon Sep 17 00:00:00 2001
+From: David Howells <dhowells@redhat.com>
+Date: Mon, 25 Mar 2019 16:38:22 +0000
+Subject: vfs: Fix refcounting of filenames in fs_parser
+
+From: David Howells <dhowells@redhat.com>
+
+commit 7cdfa44227b0d8842d46a775cebe4311150cb8f2 upstream.
+
+Fix an overput in which filename_lookup() unconditionally drops a ref to
+the filename it was given, but this isn't taken account of in the caller,
+fs_lookup_param().
+
+Addresses-Coverity-ID: 1443811 ("Use after free")
+Signed-off-by: David Howells <dhowells@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/fs_parser.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/fs/fs_parser.c
++++ b/fs/fs_parser.c
+@@ -264,6 +264,7 @@ int fs_lookup_param(struct fs_context *f
+               return invalf(fc, "%s: not usable as path", param->key);
+       }
++      f->refcnt++; /* filename_lookup() drops our ref. */
+       ret = filename_lookup(param->dirfd, f, flags, _path, NULL);
+       if (ret < 0) {
+               errorf(fc, "%s: Lookup failure for '%s'", param->key, f->name);