]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.18-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Jan 2019 13:52:12 +0000 (14:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Jan 2019 13:52:12 +0000 (14:52 +0100)
added patches:
media-vb2-be-sure-to-unlock-mutex-on-errors.patch

queue-3.18/media-vb2-be-sure-to-unlock-mutex-on-errors.patch [new file with mode: 0644]
queue-3.18/series

diff --git a/queue-3.18/media-vb2-be-sure-to-unlock-mutex-on-errors.patch b/queue-3.18/media-vb2-be-sure-to-unlock-mutex-on-errors.patch
new file mode 100644 (file)
index 0000000..214ad1d
--- /dev/null
@@ -0,0 +1,42 @@
+From c06ef2e9acef4cda1feee2ce055b8086e33d251a Mon Sep 17 00:00:00 2001
+From: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
+Date: Fri, 23 Nov 2018 07:05:58 -0500
+Subject: media: vb2: be sure to unlock mutex on errors
+
+From: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
+
+commit c06ef2e9acef4cda1feee2ce055b8086e33d251a upstream.
+
+As reported by smatch:
+drivers/media/common/videobuf2/videobuf2-core.c: drivers/media/common/videobuf2/videobuf2-core.c:2159 vb2_mmap() warn: inconsistent returns 'mutex:&q->mmap_lock'.
+  Locked on:   line 2148
+  Unlocked on: line 2100
+               line 2108
+               line 2113
+               line 2118
+               line 2156
+               line 2159
+
+There is one error condition that doesn't unlock a mutex.
+
+Fixes: cd26d1c4d1bc ("media: vb2: vb2_mmap: move lock up")
+Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
+Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/media/v4l2-core/videobuf2-core.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/media/v4l2-core/videobuf2-core.c
++++ b/drivers/media/v4l2-core/videobuf2-core.c
+@@ -2501,7 +2501,8 @@ int vb2_mmap(struct vb2_queue *q, struct
+       if (length < (vma->vm_end - vma->vm_start)) {
+               dprintk(1,
+                       "MMAP invalid, as it would overflow buffer length\n");
+-              return -EINVAL;
++              ret = -EINVAL;
++              goto unlock;
+       }
+       ret = call_memop(vb, mmap, vb->planes[plane].mem_priv, vma);
index f628d3b7189e576b589090fef609b030942a0d67..7688b6a7d8aa53a591e8d3b83eea3933347ed0d5 100644 (file)
@@ -30,3 +30,4 @@ selinux-fix-gpf-on-invalid-policy.patch
 sctp-allocate-sctp_sockaddr_entry-with-kzalloc.patch
 block-loop-use-global-lock-for-ioctl-operation.patch
 drm-fb-helper-ignore-the-value-of-fb_var_screeninfo.pixclock.patch
+media-vb2-be-sure-to-unlock-mutex-on-errors.patch