]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Apr 2022 16:03:38 +0000 (18:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Apr 2022 16:03:38 +0000 (18:03 +0200)
added patches:
staging-ion-prevent-incorrect-reference-counting-behavour.patch

queue-4.19/series
queue-4.19/staging-ion-prevent-incorrect-reference-counting-behavour.patch [new file with mode: 0644]

index 28b80e038dd4f0bd6427225f38efeba7712f66f9..a716bd9b983493b940d6fc2885ed3e1c3d51a330 100644 (file)
@@ -40,3 +40,4 @@ ext4-fix-symlink-file-size-not-match-to-file-content.patch
 ext4-limit-length-to-bitmap_maxbytes-blocksize-in-punch_hole.patch
 ext4-fix-overhead-calculation-to-account-for-the-reserved-gdt-blocks.patch
 ext4-force-overhead-calculation-if-the-s_overhead_cluster-makes-no-sense.patch
+staging-ion-prevent-incorrect-reference-counting-behavour.patch
diff --git a/queue-4.19/staging-ion-prevent-incorrect-reference-counting-behavour.patch b/queue-4.19/staging-ion-prevent-incorrect-reference-counting-behavour.patch
new file mode 100644 (file)
index 0000000..ee4cdf0
--- /dev/null
@@ -0,0 +1,31 @@
+From lee.jones@linaro.org  Mon Apr 25 17:58:17 2022
+From: Lee Jones <lee.jones@linaro.org>
+Date: Mon, 25 Apr 2022 16:51:54 +0100
+Subject: staging: ion: Prevent incorrect reference counting behavour
+To: lee.jones@linaro.org
+Cc: stable@vger.kernel.org, Dan Carpenter <dan.carpenter@oracle.com>
+Message-ID: <20220425155154.2742426-1-lee.jones@linaro.org>
+
+
+Supply additional check in order to prevent unexpected results.
+
+Fixes: b892bf75b2034 ("ion: Switch ion to use dma-buf")
+Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: Lee Jones <lee.jones@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/staging/android/ion/ion.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/staging/android/ion/ion.c
++++ b/drivers/staging/android/ion/ion.c
+@@ -140,6 +140,9 @@ static void *ion_buffer_kmap_get(struct
+       void *vaddr;
+       if (buffer->kmap_cnt) {
++              if (buffer->kmap_cnt == INT_MAX)
++                      return ERR_PTR(-EOVERFLOW);
++
+               buffer->kmap_cnt++;
+               return buffer->vaddr;
+       }