The Linux ioctl scheme passes raw user-space pointers to drivers,
natively supporting Flexible Array Members (FAM). In contrast, linuxkpi
currently relies on FreeBSD's sys_ioctl automatic copying. It provides a
"fake" pointer backed by fixed-size kernel memory, which fails for FAMs
and does not fully conform to Linux ioctl semantics.
This patch adds a fallback mechanism in linux_remap_address() that uses
the original user-space pointer when access exceeds the pre-copied
kernel buffer.
I do a simple static scan of Linux 6.19 UAPI headers indicates that more
than 30 structures across subsystems (including KVM, USB, and DRM) rely
on this pattern. It seems like a valuable compatibility improvement for
future driver ports like udmabuf.
Link: https://mail-archive.freebsd.org/cgi/getmsg.cgi?fetch=408318+0+archive/2026/freebsd-hackers/20260216.freebsd-hackers
Signed-off-by: Zishun Yi <zishun.yi.dev@gmail.com>