linux/kernel/liveupdate
Jackie Liu 4416f8a9ed liveupdate: fix GET_NAME ioctl argument validation
LIVEUPDATE_SESSION_GET_NAME was developed in the liveupdate/next branch
while the session type validation change was carried in liveupdate-fixes.
When the conflict between the two branches was resolved, the GET_NAME
operation descriptor picked up the structure and last member from
RETRIEVE_FD.

This makes both its known size and minimum size 16 bytes rather than 72.
A zero-initialized request still succeeds because luo_session_get_name()
writes the full name before luo_ucmd_respond() copies the full GET_NAME
response to userspace. However, copy_struct_from_user() treats the
output-only name field as unknown trailing data and rejects the request
with -E2BIG if any byte in that field is nonzero.

Use the GET_NAME structure and its name field in the descriptor.

Link: https://lore.kernel.org/all/ahWlYXNjGUbkKoHy@sirena.org.uk/
Assisted-by: Codex:gpt-5.6-sol
Reviewed-by: Pratyush Yadav (Google) <pratyush@kernel.org>
Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
Link: https://patch.msgid.link/20260716012607.22020-1-liu.yun@linux.dev
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
2026-07-16 09:25:30 +03:00
..
Kconfig kho: make preserved pages compatible with deferred struct page init 2026-06-01 02:31:37 +03:00
kexec_handover_debug.c
kexec_handover_debugfs.c kho: fix kho_in_debugfs_init() to handle non-FDT blobs 2026-04-18 00:10:48 -07:00
kexec_handover_internal.h kho: rename fdt parameter to blob in kho_add/remove_subtree() 2026-04-18 00:10:48 -07:00
kexec_handover.c kho: make sure scratch size is always aligned by CMA_MIN_ALIGNMENT_BYTES 2026-06-01 09:19:38 +03:00
kho_block.c kho: add support for linked-block serialization 2026-06-03 21:15:46 +03:00
luo_core.c liveupdate: defer session block allocation and physical address setting 2026-06-03 21:15:46 +03:00
luo_file.c liveupdate: Remove limit on the number of files per session 2026-06-03 21:15:46 +03:00
luo_flb.c liveupdate: centralize state management into struct luo_ser 2026-06-03 21:15:45 +03:00
luo_internal.h liveupdate: Remove limit on the number of files per session 2026-06-03 21:15:46 +03:00
luo_session.c liveupdate: fix GET_NAME ioctl argument validation 2026-07-16 09:25:30 +03:00
Makefile kho: add support for linked-block serialization 2026-06-03 21:15:46 +03:00