From: Greg Kroah-Hartman Date: Mon, 25 Apr 2022 16:03:55 +0000 (+0200) Subject: 5.10-stable patches X-Git-Tag: v4.9.312~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7f2972a839c42220667e42d3873042347c6f56f5;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: staging-ion-prevent-incorrect-reference-counting-behavour.patch --- diff --git a/queue-5.10/series b/queue-5.10/series index 4147022e355..2a4d3bb5ee1 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -81,3 +81,4 @@ ext4-force-overhead-calculation-if-the-s_overhead_cluster-makes-no-sense.patch can-isotp-stop-timeout-monitoring-when-no-first-frame-was-sent.patch jbd2-fix-a-potential-race-while-discarding-reserved-buffers-after-an-abort.patch spi-atmel-quadspi-fix-the-buswidth-adjustment-between-spi-mem-and-controller.patch +staging-ion-prevent-incorrect-reference-counting-behavour.patch diff --git a/queue-5.10/staging-ion-prevent-incorrect-reference-counting-behavour.patch b/queue-5.10/staging-ion-prevent-incorrect-reference-counting-behavour.patch new file mode 100644 index 00000000000..5dc47b6fbaf --- /dev/null +++ b/queue-5.10/staging-ion-prevent-incorrect-reference-counting-behavour.patch @@ -0,0 +1,31 @@ +From lee.jones@linaro.org Mon Apr 25 17:58:17 2022 +From: Lee Jones +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 +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 +Signed-off-by: Lee Jones +Signed-off-by: Greg Kroah-Hartman +--- + 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 +@@ -114,6 +114,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; + }