• Arnd Bergmann's avatar
    media: v4l2-core: fix v4l2_buffer handling for time64 ABI · 577c89b0
    Arnd Bergmann authored
    The v4l2_buffer structure contains a 'struct timeval' member that is
    defined by the user space C library, creating an ABI incompatibility
    when that gets updated to a 64-bit time_t.
    
    As in v4l2_event, handle this with a special case in video_put_user()
    and video_get_user() to replace the memcpy there.
    
    Since the structure also contains a pointer, there are now two
    native versions (on 32-bit systems) as well as two compat versions
    (on 64-bit systems), which unfortunately complicates the compat
    handler quite a bit.
    
    Duplicating the existing handlers for the new types is a safe
    conversion for now, but unfortunately this may turn into a
    maintenance burden later. A larger-scale rework of the
    compat code might be a better alternative, but is out of scope
    of the y2038 work.
    
    Sparc64 needs a special case because of their special suseconds_t
    definition.
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
    577c89b0
v4l2-ioctl.h 32.8 KB