Patch "[media] cx25840: fix unchecked return values" has been added to the 4.4-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
[media] cx25840: fix unchecked return values
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:
cx25840-fix-unchecked-return-values.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 <[email protected]> know about it.
Quoted 1 line
From foo@baz Tue Apr 10 10:31:53 CEST 2018
From: Pan Bian <[email protected]>
Date: Sun, 23 Apr 2017 10:06:36 -0300
Subject: [media] cx25840: fix unchecked return values
From: Pan Bian <[email protected]>
[ Upstream commit 35378ce143071c2a6bad4b59a000e9b9f8f6ea67 ]
In functions cx25840_initialize(), cx231xx_initialize(), and cx23885_initialize(), the return value of create_singlethread_workqueue() is used without validation. This may result in NULL dereference and cause kernel crash. This patch fixes it.
--- drivers/media/i2c/cx25840/cx25840-core.c | 36 ++++++++++++++++++------------- 1 file changed, 21 insertions(+), 15 deletions(-)
drivers/media/i2c/cx25840/cx25840-core.c +21 -15
@@ -420,11 +420,13 @@ static void cx25840_initialize(struct i2INIT_WORK (&state->fw_work, cx25840_work_handler);init_waitqueue_head (&state->fw_wait); q =create_singlethread_workqueue ("cx25840_fw" ); -prepare_to_wait (&state->fw_wait, &wait,TASK_UNINTERRUPTIBLE ); -queue_work (q, &state->fw_work); -schedule (); -finish_wait (&state->fw_wait, &wait); -destroy_workqueue (q); +if (q) { +prepare_to_wait (&state->fw_wait, &wait,TASK_UNINTERRUPTIBLE ); +queue_work (q, &state->fw_work); +schedule (); +finish_wait (&state->fw_wait, &wait); +destroy_workqueue (q); + }/* 6. */ cx25840_write (client,0x115 ,0x8c );
@@ -631,11 +633,13 @@ static void cx23885_initialize(struct i2INIT_WORK (&state->fw_work, cx25840_work_handler);init_waitqueue_head (&state->fw_wait); q =create_singlethread_workqueue ("cx25840_fw" ); -prepare_to_wait (&state->fw_wait, &wait,TASK_UNINTERRUPTIBLE ); -queue_work (q, &state->fw_work); -schedule (); -finish_wait (&state->fw_wait, &wait); -destroy_workqueue (q); +if (q) { +prepare_to_wait (&state->fw_wait, &wait,TASK_UNINTERRUPTIBLE ); +queue_work (q, &state->fw_work); +schedule (); +finish_wait (&state->fw_wait, &wait); +destroy_workqueue (q); + }/* Call the cx23888 specific std setup func, we no longer rely on * the generic cx24840 func.
@@ -746,11 +750,13 @@ static void cx231xx_initialize(struct i2INIT_WORK (&state->fw_work, cx25840_work_handler);init_waitqueue_head (&state->fw_wait); q =create_singlethread_workqueue ("cx25840_fw" ); -prepare_to_wait (&state->fw_wait, &wait,TASK_UNINTERRUPTIBLE ); -queue_work (q, &state->fw_work); -schedule (); -finish_wait (&state->fw_wait, &wait); -destroy_workqueue (q); +if (q) { +prepare_to_wait (&state->fw_wait, &wait,TASK_UNINTERRUPTIBLE ); +queue_work (q, &state->fw_work); +schedule (); +finish_wait (&state->fw_wait, &wait); +destroy_workqueue (q); + }cx25840_std_setup (client);
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/cx25840-fix-unchecked-return-values.patch queue-4.4/usb-dwc3-keystone-check-return-value.patch queue-4.4/rtc-snvs-fix-an-incorrect-check-of-return-value.patch