2024-06-11 10:53:09

by Ekansh Gupta

[permalink] [raw]
Subject: [PATCH v5 0/7] Add missing fixes to FastRPC driver

This patch series adds the listed bug fixes that have been missing
in upstream fastRPC driver.
- Fix DSP capabilities request.
- Fix issues in audio daemon attach operation.
- Restrict untrusted app to attach to privilegeded PD.

Changes in v2:
- Added separate patch to add newlines in dev_err.
- Added a bug fix in fastrpc capability function.
- Added a new patch to save and restore interrupted context.
- Fixed config dependency for PDR support.

Changes in v3:
- Dropped interrupted context patch.
- Splitted few of the bug fix patches.
- Added Fixes tag wherever applicable.
- Updated proper commit message for few of the patches.

Changes in v4:
- Dropped untrusted process and system unsigned PD patches.
- Updated proper commit message for few of the patches.
- Splitted patches in more meaningful way.
- Added helped functions for fastrpc_req_mmap.

Changes in v5:
- Dropped PDR patch. It will be shared in a separate patch series.
- Dropped fastrpc_req_mmap and remote_heap specific changes from this
series. These patches will be shared separately as a new patch series.
- Changed patch series subject as this series is no longer carrying any
new feature changes.

Ekansh Gupta (7):
misc: fastrpc: Add missing dev_err newlines
misc: fastrpc: Fix DSP capabilities request
misc: fastrpc: Copy the complete capability structure to user
misc: fastrpc: Avoid updating PD type for capability request
misc: fastrpc: Fix memory leak in audio daemon attach operation
misc: fastrpc: Fix ownership reassignment of remote heap
misc: fastrpc: Restrict untrusted app to attach to privileged PD

drivers/misc/fastrpc.c | 51 +++++++++++++++++++++++++++----------
include/uapi/misc/fastrpc.h | 3 +++
2 files changed, 40 insertions(+), 14 deletions(-)

--
2.43.0



2024-06-11 10:54:13

by Ekansh Gupta

[permalink] [raw]
Subject: [PATCH v5 3/7] 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: 6c16fd8bdd40 ("misc: fastrpc: Add support to get DSP capabilities")
Cc: stable <[email protected]>
Signed-off-by: Ekansh Gupta <[email protected]>
Reviewed-by: Dmitry Baryshkov <[email protected]>
Reviewed-by: Caleb Connolly <[email protected]>
---
drivers/misc/fastrpc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index 0c5bba1d355e..c033865d8059 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -1788,7 +1788,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)))
return -EFAULT;

return 0;
--
2.43.0


2024-06-11 11:54:50

by Srinivas Kandagatla

[permalink] [raw]
Subject: Re: (subset) [PATCH v5 0/7] Add missing fixes to FastRPC driver


On Tue, 11 Jun 2024 16:04:33 +0530, Ekansh Gupta wrote:
> This patch series adds the listed bug fixes that have been missing
> in upstream fastRPC driver.
> - Fix DSP capabilities request.
> - Fix issues in audio daemon attach operation.
> - Restrict untrusted app to attach to privilegeded PD.
>
> Changes in v2:
> - Added separate patch to add newlines in dev_err.
> - Added a bug fix in fastrpc capability function.
> - Added a new patch to save and restore interrupted context.
> - Fixed config dependency for PDR support.
>
> [...]

Applied, thanks!

[2/7] misc: fastrpc: Fix DSP capabilities request
commit: 8bac43bb507f1fe6e56762ca350c8b6f41096959
[3/7] misc: fastrpc: Copy the complete capability structure to user
commit: 552244bb57914612f4db79f0f52c6130af45c50b
[4/7] misc: fastrpc: Avoid updating PD type for capability request
commit: 7718647366694bf1821a87e08a2ee4ef62012270
[5/7] misc: fastrpc: Fix memory leak in audio daemon attach operation
commit: f3080b096933b6633d71e5345f72a79ec25faaa9
[6/7] misc: fastrpc: Fix ownership reassignment of remote heap
commit: 2a732868df39b717046a4f03c40f84db8be9c687
[7/7] misc: fastrpc: Restrict untrusted app to attach to privileged PD
commit: 435f39b8991cd719fbbceb6872602629417c9272

Best regards,
--
Srinivas Kandagatla <[email protected]>


2024-06-11 11:59:05

by Srinivas Kandagatla

[permalink] [raw]
Subject: Re: (subset) [PATCH v5 0/7] Add missing fixes to FastRPC driver


On Tue, 11 Jun 2024 16:04:33 +0530, Ekansh Gupta wrote:
> This patch series adds the listed bug fixes that have been missing
> in upstream fastRPC driver.
> - Fix DSP capabilities request.
> - Fix issues in audio daemon attach operation.
> - Restrict untrusted app to attach to privilegeded PD.
>
> Changes in v2:
> - Added separate patch to add newlines in dev_err.
> - Added a bug fix in fastrpc capability function.
> - Added a new patch to save and restore interrupted context.
> - Fixed config dependency for PDR support.
>
> [...]

Applied, thanks!

[1/7] misc: fastrpc: Add missing dev_err newlines
commit: 372eb825c2040b81b6c20b8ff662a6a551f236f9

Best regards,
--
Srinivas Kandagatla <[email protected]>


2024-06-11 12:23:28

by Srinivas Kandagatla

[permalink] [raw]
Subject: Re: [PATCH v5 0/7] Add missing fixes to FastRPC driver

Thanks for Patches,

Please send the patches in correct order, fixes will follow enhancements.



--srini

On 11/06/2024 11:34, Ekansh Gupta wrote:
> This patch series adds the listed bug fixes that have been missing
> in upstream fastRPC driver.
> - Fix DSP capabilities request.
> - Fix issues in audio daemon attach operation.
> - Restrict untrusted app to attach to privilegeded PD.
>
> Changes in v2:
> - Added separate patch to add newlines in dev_err.
> - Added a bug fix in fastrpc capability function.
> - Added a new patch to save and restore interrupted context.
> - Fixed config dependency for PDR support.
>
> Changes in v3:
> - Dropped interrupted context patch.
> - Splitted few of the bug fix patches.
> - Added Fixes tag wherever applicable.
> - Updated proper commit message for few of the patches.
>
> Changes in v4:
> - Dropped untrusted process and system unsigned PD patches.
> - Updated proper commit message for few of the patches.
> - Splitted patches in more meaningful way.
> - Added helped functions for fastrpc_req_mmap.
>
> Changes in v5:
> - Dropped PDR patch. It will be shared in a separate patch series.
> - Dropped fastrpc_req_mmap and remote_heap specific changes from this
> series. These patches will be shared separately as a new patch series.
> - Changed patch series subject as this series is no longer carrying any
> new feature changes.
>
> Ekansh Gupta (7):
> misc: fastrpc: Add missing dev_err newlines
> misc: fastrpc: Fix DSP capabilities request
> misc: fastrpc: Copy the complete capability structure to user
> misc: fastrpc: Avoid updating PD type for capability request
> misc: fastrpc: Fix memory leak in audio daemon attach operation
> misc: fastrpc: Fix ownership reassignment of remote heap
> misc: fastrpc: Restrict untrusted app to attach to privileged PD
>
> drivers/misc/fastrpc.c | 51 +++++++++++++++++++++++++++----------
> include/uapi/misc/fastrpc.h | 3 +++
> 2 files changed, 40 insertions(+), 14 deletions(-)
>