All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/8] RFC/RFT: y2038 safety in v4l2
@ 2019-11-06 19:47 Arnd Bergmann
  2019-11-06 19:47 ` [PATCH v3 1/8] media: documentation: fix video_event description Arnd Bergmann
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Arnd Bergmann @ 2019-11-06 19:47 UTC (permalink / raw)
  To: Hans Verkuil, Mauro Carvalho Chehab
  Cc: linux-media, linux-kernel, y2038, Boris Brezillon, Maxime Ripard,
	Laurent Pinchart, Tiffany Lin, Daniel Mentz, Arnd Bergmann

I'm in the process of finishing up the last bits on y2038-unsafe
code in the kernel, this series is for v4l2, which has no problem
with overflow, but has multiple ioctls that break with user space
built against a new 32-bit libc.

I posted similar patches as part of a series back in 2015, the
new version was rewritten from scratch and I double-checked with
the old version to make sure I did not miss anything I had already
taken care of before.

Hans Verkuil worked on a different patch set in 2017, but this
also did not get to the point of being merged.

My new version contains compat-ioctl support, which the old one
did not and should be complete, but given its size likely contains
bugs. I did randconfig build tests, but no runtime test, so
careful review as well as testing would be much appreciated.

With this version, the newly added code takes care of the existing
ABI, while the existing code got moved to the 64-bit time_t
interface and is used internally. This means that testing with
existing binaries should exercise most of the modifications
and if that works and doesn't get shot down in review, we can
probably live without testing the new ABI explicitly.

I'm not entirely happy with the compat-ioctl implementation that
adds quite a bit of code duplication, but I hope this is
acceptable anyway, as a better implementation would likely
require a larger refactoring of the compat-ioctl file, while
my approach simply adds support for the additional data structure
variants.

The patches apply cleanly on either v5.4-rc4 or the media-tree
master branch. I uploaded a copy to [2] for easier testing.

      Arnd

[1] https://lwn.net/Articles/657754/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/log/?h=y2038-v4l2

Arnd Bergmann (8):
  media: documentation: fix video_event description
  media: v4l2: abstract timeval handling in v4l2_buffer
  media: v4l2-core: ignore native command codes
  media: v4l2-core: split out data copy from video_usercopy
  media: v4l2-core: fix VIDIOC_DQEVENT for time64 ABI
  media: v4l2-core: fix v4l2_buffer handling for time64 ABI
  media: v4l2-core: fix compat VIDIOC_DQEVENT for time64 ABI
  media: v4l2-core: fix compat v4l2_buffer handling for time64 ABI

 .../media/uapi/dvb/video-get-event.rst        |   2 +-
 Documentation/media/uapi/dvb/video_types.rst  |   2 +-
 .../media/common/videobuf2/videobuf2-v4l2.c   |   4 +-
 drivers/media/pci/meye/meye.c                 |   4 +-
 drivers/media/usb/cpia2/cpia2_v4l.c           |   4 +-
 drivers/media/usb/stkwebcam/stk-webcam.c      |   2 +-
 drivers/media/usb/usbvision/usbvision-video.c |   4 +-
 drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 464 +++++++++++++++---
 drivers/media/v4l2-core/v4l2-event.c          |   5 +-
 drivers/media/v4l2-core/v4l2-ioctl.c          | 186 +++++--
 drivers/media/v4l2-core/v4l2-subdev.c         |  20 +-
 drivers/media/v4l2-core/videobuf-core.c       |   4 +-
 include/linux/videodev2.h                     |  17 +-
 include/trace/events/v4l2.h                   |   2 +-
 include/uapi/linux/videodev2.h                |  72 +++
 15 files changed, 660 insertions(+), 132 deletions(-)

-- 
2.20.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-11-06 20:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-06 19:47 [PATCH v3 0/8] RFC/RFT: y2038 safety in v4l2 Arnd Bergmann
2019-11-06 19:47 ` [PATCH v3 1/8] media: documentation: fix video_event description Arnd Bergmann
2019-11-06 19:47 ` [PATCH v3 2/8] media: v4l2: abstract timeval handling in v4l2_buffer Arnd Bergmann
2019-11-06 19:47 ` [PATCH v3 3/8] media: v4l2-core: ignore native command codes Arnd Bergmann
2019-11-06 20:18   ` Arnd Bergmann
2019-11-06 19:47 ` [PATCH v3 4/8] media: v4l2-core: split out data copy from video_usercopy Arnd Bergmann
2019-11-06 19:47 ` [PATCH v3 5/8] media: v4l2-core: fix VIDIOC_DQEVENT for time64 ABI Arnd Bergmann
2019-11-06 19:47 ` [PATCH v3 6/8] media: v4l2-core: fix v4l2_buffer handling " Arnd Bergmann
2019-11-06 19:47 ` [PATCH v3 7/8] media: v4l2-core: fix compat VIDIOC_DQEVENT " Arnd Bergmann
2019-11-06 19:47 ` [PATCH v3 8/8] media: v4l2-core: fix compat v4l2_buffer handling " Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.