• Arnd Bergmann's avatar
    media: v4l2: prepare compat-ioctl rework · 8dbcc3fa
    Arnd Bergmann authored
    The v4l2-compat-ioctl32() currently takes an extra round trip through user
    space pointers when converting the data structure formats. In particular,
    this involves using the compat_alloc_user_space() and copy_in_user()
    helpers that often lead to worse compat handlers compared to using
    in_compat_syscall() checks when copying the data.
    
    The native implementation already gained a simpler method to deal with
    the conversion for the time32 conversion.  Hook into the same places to
    provide a location for reading and writing user space data from inside
    of the generic video_usercopy() helper.
    
    Hans Verkuil rewrote the video_get_user() function here to simplify
    the zeroing of the extra input fields and fixed a couple of bugs in
    the original implementation.
    
    [hverkuil: fix: CHECK: Please don't use multiple blank lines]
    Co-developed-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
    8dbcc3fa
v4l2-ioctl.h 33.3 KB