From: Greg Kroah-Hartman Date: Mon, 1 Aug 2022 08:54:09 +0000 (+0200) Subject: 4.9-stable patches X-Git-Tag: v5.4.209~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=db180e9d48d28597fb3262a535bf9d44a2323ff7;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: ion-make-user_ion_handle_put_nolock-a-void-function.patch --- diff --git a/queue-4.9/ion-make-user_ion_handle_put_nolock-a-void-function.patch b/queue-4.9/ion-make-user_ion_handle_put_nolock-a-void-function.patch new file mode 100644 index 00000000000..d9696796942 --- /dev/null +++ b/queue-4.9/ion-make-user_ion_handle_put_nolock-a-void-function.patch @@ -0,0 +1,58 @@ +From nathan@kernel.org Mon Aug 1 10:53:38 2022 +From: Nathan Chancellor +Date: Wed, 27 Jul 2022 09:46:17 -0700 +Subject: ion: Make user_ion_handle_put_nolock() a void function +To: Greg Kroah-Hartman , Sasha Levin +Cc: Daniel Rosenberg , stable@vger.kernel.org, llvm@lists.linux.dev, Nathan Chancellor , kernel test robot +Message-ID: <20220727164617.980209-1-nathan@kernel.org> + +From: Nathan Chancellor + +Clang warns: + + drivers/staging/android/ion/ion-ioctl.c:71:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] + if (--handle->user_ref_count == 0) + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + drivers/staging/android/ion/ion-ioctl.c:74:9: note: uninitialized use occurs here + return ret; + ^~~ + drivers/staging/android/ion/ion-ioctl.c:71:2: note: remove the 'if' if its condition is always true + if (--handle->user_ref_count == 0) + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + drivers/staging/android/ion/ion-ioctl.c:69:9: note: initialize the variable 'ret' to silence this warning + int ret; + ^ + = 0 + 1 warning generated. + +The return value of user_ion_handle_put_nolock() is not checked in its +one call site in user_ion_free_nolock() so just make +user_ion_handle_put_nolock() return void to remove the warning. + +Fixes: a8200613c8c9 ("ion: Protect kref from userspace manipulation") +Reported-by: kernel test robot +Signed-off-by: Nathan Chancellor +Signed-off-by: Greg Kroah-Hartman +--- + drivers/staging/android/ion/ion-ioctl.c | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +--- a/drivers/staging/android/ion/ion-ioctl.c ++++ b/drivers/staging/android/ion/ion-ioctl.c +@@ -64,14 +64,10 @@ static struct ion_handle *pass_to_user(s + } + + /* Must hold the client lock */ +-static int user_ion_handle_put_nolock(struct ion_handle *handle) ++static void user_ion_handle_put_nolock(struct ion_handle *handle) + { +- int ret; +- + if (--handle->user_ref_count == 0) +- ret = ion_handle_put_nolock(handle); +- +- return ret; ++ ion_handle_put_nolock(handle); + } + + static void user_ion_free_nolock(struct ion_client *client, diff --git a/queue-4.9/series b/queue-4.9/series index 06236f56dbd..a34b8520a0b 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -6,3 +6,4 @@ net-sungem_phy-add-of_node_put-for-reference-returne.patch netfilter-nf_queue-do-not-allow-packet-truncation-be.patch arm-crypto-comment-out-gcc-warning-that-breaks-clang-builds.patch mt7601u-add-usb-device-id-for-some-versions-of-xiaodu-wifi-dongle.patch +ion-make-user_ion_handle_put_nolock-a-void-function.patch