Patch "staging: ion: Prevent incorrect reference counting behavour" has been added to the 4.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    staging: ion: Prevent incorrect reference counting behavour

to the 4.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     staging-ion-prevent-incorrect-reference-counting-behavour.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From lee.jones@xxxxxxxxxx  Sat Nov 27 12:56:17 2021
From: Lee Jones <lee.jones@xxxxxxxxxx>
Date: Fri, 26 Nov 2021 10:33:35 +0000
Subject: staging: ion: Prevent incorrect reference counting behavour
To: lee.jones@xxxxxxxxxx
Cc: devel@xxxxxxxxxxxxxxxxxxxx, arve@xxxxxxxxxxx, stable@xxxxxxxxxxxxxxx, riandrews@xxxxxxxxxxx, labbott@xxxxxxxxxx, sumit.semwal@xxxxxxxxxx, Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Message-ID: <20211126103335.880816-1-lee.jones@xxxxxxxxxx>

From: Lee Jones <lee.jones@xxxxxxxxxx>

Supply additional checks in order to prevent unexpected results.

Fixes: b892bf75b2034 ("ion: Switch ion to use dma-buf")
Suggested-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Signed-off-by: Lee Jones <lee.jones@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
 drivers/staging/android/ion/ion.c |    6 ++++++
 1 file changed, 6 insertions(+)

--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -606,6 +606,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;
 	}
@@ -626,6 +629,9 @@ static void *ion_handle_kmap_get(struct
 	void *vaddr;
 
 	if (handle->kmap_cnt) {
+		if (handle->kmap_cnt == INT_MAX)
+			return ERR_PTR(-EOVERFLOW);
+
 		handle->kmap_cnt++;
 		return buffer->vaddr;
 	}


Patches currently in stable-queue which might be from lee.jones@xxxxxxxxxx are

queue-4.4/staging-ion-prevent-incorrect-reference-counting-behavour.patch
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux