On Mon, Jun 03, 2024 at 12:35:40PM +0530, Ekansh Gupta wrote: > > > On 5/31/2024 3:03 PM, Srinivas Kandagatla wrote: > > > > > > On 30/05/2024 11:20, Ekansh Gupta wrote: > >> Incorrect remote arguments are getting passed when requesting for > >> capabilities from DSP. Also there is no requirement to update the > >> PD type as it might cause problems for any PD other than user PD. > >> In addition to this, the collected capability information is not > >> getting copied properly to user. Add changes to address these > >> problems and get correct DSP capabilities. > >> > >> Fixes: 6c16fd8bdd40 ("misc: fastrpc: Add support to get DSP capabilities") > >> Cc: stable <stable@xxxxxxxxxx> > >> Signed-off-by: Ekansh Gupta <quic_ekangupt@xxxxxxxxxxx> > >> --- > >> drivers/misc/fastrpc.c | 7 +++---- > >> 1 file changed, 3 insertions(+), 4 deletions(-) > > > > > >> if (err == DSP_UNSUPPORTED_API) { > >> dev_info(&cctx->rpdev->dev, > >> "Warning: DSP capabilities not supported on domain: %d\n", domain); > >> @@ -1783,7 +1782,7 @@ static int fastrpc_get_dsp_info(struct fastrpc_user *fl, char __user *argp) > >> if (err) > >> return err; > >> - if (copy_to_user(argp, &cap.capability, sizeof(cap.capability))) > >> + if (copy_to_user(argp, &cap, sizeof(cap))) > > > > Why are we copying the full struct here? All that user needs is cap.capability? > as argp sent from user during ioctl is the capability structure, the > same argp is copied to a local fastrpc_ioctl_capability structure(cap) > to get the domain and attribute_id information. Copying just the > capability member to argp will cause problem when the user tries to > read the capability. While testing the capability, I was observing > this failure and it is resolved once we copy the information properly. What kind of failure? Which problems? Why do we need to get all the details from you by asking for more and more details. All this information must be explained in the commit message. [please wrap your lines in a some sensible way, I had to do that for you] > > > > > > > > --srini > > > > > >> return -EFAULT; > >> return 0; > > > -- With best wishes Dmitry