diff options
author | Yasumasa Suenaga <yasuenag@gmail.com> | 2025-06-28 11:22:17 +0900 |
---|---|---|
committer | Wei Liu <wei.liu@kernel.org> | 2025-07-09 23:01:55 +0000 |
commit | 0d86a8d65c1e69610bfe1a7a774f71ff111ed8c1 (patch) | |
tree | 3c590608aa010647bbf7c40ed580bbd3b77d50b4 /scripts/lib/kdoc/kdoc_files.py | |
parent | 7b89a44b2e8c7ba548e3ad5d5155a17279625335 (diff) |
tools/hv: fcopy: Fix incorrect file path conversion
The hv_fcopy_uio_daemon fails to correctly handle file copy requests
from Windows hosts (e.g. via Copy-VMFile) due to wchar_t size
differences between Windows and Linux. On Linux, wchar_t is 32 bit,
whereas Windows uses 16 bit wide characters.
Fix this by ensuring that file transfers from host to Linux guest
succeed with correctly decoded file names and paths.
- Treats file name and path as __u16 arrays, not wchar_t*.
- Allocates fixed-size buffers (W_MAX_PATH) for converted strings
instead of using malloc.
- Adds a check for target path length to prevent snprintf() buffer
overflow.
Fixes: 82b0945ce2c2 ("tools: hv: Add new fcopy application based on uio driver")
Signed-off-by: Yasumasa Suenaga <yasuenag@gmail.com>
Reviewed-by: Naman Jain <namjain@linux.microsoft.com>
Link: https://lore.kernel.org/r/20250628022217.1514-2-yasuenag@gmail.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Message-ID: <20250628022217.1514-2-yasuenag@gmail.com>
Diffstat (limited to 'scripts/lib/kdoc/kdoc_files.py')
0 files changed, 0 insertions, 0 deletions