Skip to content

Commit

Permalink
staging: vchiq: Fix bulk userdata handling
Browse files Browse the repository at this point in the history
The addition of the local 'userdata' pointer to
vchiq_irq_queue_bulk_tx_rx omitted the case where neither BLOCKING nor
WAITING modes are used, in which case the value provided by the
caller is not returned to them as expected, but instead it is replaced
with a NULL. This lack of a suitable context may cause the application
to crash or otherwise malfunction.

Fixes: 4184da4 ("staging: vchiq: fix __user annotations")
Tested-by: Stefan Wahren <[email protected]>
Acked-by: Dan Carpenter <[email protected]>
Signed-off-by: Phil Elwell <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
pelwell authored and gregkh committed Jan 7, 2021
1 parent 87bb53b commit 96ae327
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ static int vchiq_irq_queue_bulk_tx_rx(struct vchiq_instance *instance,
struct vchiq_service *service;
struct bulk_waiter_node *waiter = NULL;
bool found = false;
void *userdata = NULL;
void *userdata;
int status = 0;
int ret;

Expand Down Expand Up @@ -997,6 +997,8 @@ static int vchiq_irq_queue_bulk_tx_rx(struct vchiq_instance *instance,
"found bulk_waiter %pK for pid %d", waiter,
current->pid);
userdata = &waiter->bulk_waiter;
} else {
userdata = args->userdata;
}

status = vchiq_bulk_transfer(args->handle, NULL, args->data, args->size,
Expand Down

0 comments on commit 96ae327

Please sign in to comment.