fwctl: pds: report device information length
Subsystems (2)
PATCH 1/1 fwctl: pds: report device information length
pdsfc_info() allocates and populates struct fwctl_info_pds but leaves the output length unset. Consequently, fwctl_cmd_info() copies no PDS-specific data and reports a zero device_data_len even when userspace provides an output buffer.
Set *length to sizeof(*info) before returning the structure.
--- drivers/fwctl/pds/main.c | 1 + 1 file changed, 1 insertion(+)
drivers/fwctl/pds/main.c +1 -0
@@ -63,6 +63,7 @@ static void *pdsfc_info(struct fwctl_uctx *uctx, size_t *length)return ERR_PTR (-ENOMEM ); info->uctx_caps = pdsfc_uctx->uctx_caps; + *length =sizeof (*info);return info; }
base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
Signature · 1 line
2.43.0
Quoted 9 lines · Avi Weiss
pdsfc_info()allocates and populates structfwctl_info_pdsbut leaves the output length unset. Consequently,fwctl_cmd_info()copies no PDS-specific data and reports a zerodevice_data_leneven when userspace provides an output buffer.Set *length to
sizeof(*info)before returning the structure.Fixes 4d09dd11d7d0 ("pds_fwctl: initial driver framework")Signed-off-by Avi Weiss <[email protected]>
Looks pretty straight forward fix
Quoted 18 lines
--- drivers/fwctl/pds/main.c | 1 + 1 file changed, 1 insertion(+)drivers/fwctl/pds/main.c +1
-0@@ -63,6 +63,7 @@ static void *pdsfc_info(struct fwctl_uctx *uctx, size_t *length)return ERR_PTR (-ENOMEM ); info->uctx_caps = pdsfc_uctx->uctx_caps; + *length =sizeof (*info);return info; }base-commit:
cee9395acd8043be0644b25c34bfa86623f2b935
Quoted 1 line · Avi Weiss
fwctl: pds: report device information length
Applied, thanks!
[1/1] fwctl: pds: report device information length
https://git.kernel.org/pub/scm/linux/kernel/git/fwctl/fwctl.git/commit/?id=3ed98027846bf3fdb2053c626d70cde8e33ae9dd
Best regards,
Signature · 1 line
Jason