Skip to content

Commit e7f0be3

Browse files
Ekansh Guptagregkh
authored andcommitted
misc: fastrpc: Copy the complete capability structure to user
User is passing capability ioctl structure(argp) to get DSP capabilities. This argp is copied to a local structure to get domain and attribute_id information. After getting the capability, only capability value is getting copied to user argp which will not be useful if the use is trying to get the capability by checking the capability member of fastrpc_ioctl_capability structure. Copy the complete capability structure so that user can get the capability value from the expected member of the structure. Fixes: 6c16fd8 ("misc: fastrpc: Add support to get DSP capabilities") Cc: stable <stable@kernel.org> Signed-off-by: Ekansh Gupta <quic_ekangupt@quicinc.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20240628114501.14310-3-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 4cb7915 commit e7f0be3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/misc/fastrpc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1788,7 +1788,7 @@ static int fastrpc_get_dsp_info(struct fastrpc_user *fl, char __user *argp)
17881788
if (err)
17891789
return err;
17901790

1791-
if (copy_to_user(argp, &cap.capability, sizeof(cap.capability)))
1791+
if (copy_to_user(argp, &cap, sizeof(cap)))
17921792
return -EFAULT;
17931793

17941794
return 0;

0 commit comments

Comments
 (0)