y2038 safety in v4l2
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v6 Latest8 patches 2 repliesIn review
- v58 patches 10 repliesSuperseded
- v48 patches 16 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v3 | 8 patches | 1 reply | Superseded |
Changes in v6 from the cover letter
- Fix all bugs that Hans found during testing
- Add a comment about x32 still being broken
Patches in v6 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | media: documentation: fix video_event descriptionDocumentation/ Documentation/ | +2 | 1 reply | |
| 2/8 | media: v4l2: abstract timeval handling in v4l2_bufferdrivers/ drivers/ drivers/ +6 more | +36 | 0 replies | |
| 3/8 | media: v4l2-core: compat: ignore native command codesdrivers/ | +75 | 1 reply | |
| 4/8 | media: v4l2-core: split out data copy from video_usercopydrivers/ | +69 | 0 replies | |
| 5/8 | media: v4l2-core: fix VIDIOC_DQEVENT for time64 ABIdrivers/ drivers/ drivers/ +2 more | +86 | 0 replies | |
| 6/8 | media: v4l2-core: fix v4l2_buffer handling for time64 ABIdrivers/ include/ include/ | +123 | 0 replies | |
| 7/8 | media: v4l2-core: fix compat VIDIOC_DQEVENT for time64 ABIdrivers/ | +59 | 0 replies | |
| 8/8 | media: v4l2-core: fix compat v4l2_buffer handling for time64 ABIdrivers/ | +268 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v6 yet.
Cover letter [PATCH v6 0/8] y2038 safety in v4l2
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.
I uploaded git branch on top of the v4l2/dvb branch to [2].
Arnd
Changes since v5:
- Fix all bugs that Hans found during testing
- Add a comment about x32 still being broken
Changes since v4:
- Move non-public contents out of uapi header
- split out __kernel_v4l2_timeval into separate struct
- use compound initializers for v4l2_event_time32 and v4l2_buffer_time32 conversion
- add comment for v4l2_buffer_get_timestamp()
Changes since v3:
- This is a minor update compared to version 3 of this series, with bugfixes for small mistakes that I found or that were reported by automated build bots.
[1] https://lwn.net/Articles/657754/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/log/?h=y2038-v4l2-v6
Arnd Bergmann (8):
media: documentation: fix video_event description
media: v4l2: abstract timeval handling in v4l2_buffer
media: v4l2-core: compat: 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 | 477 +++++++++++++++--- drivers/media/v4l2-core/v4l2-event.c | 5 +- drivers/media/v4l2-core/v4l2-ioctl.c | 211 ++++++-- drivers/media/v4l2-core/v4l2-subdev.c | 26 +- drivers/media/v4l2-core/videobuf-core.c | 5 +- include/media/v4l2-common.h | 21 + include/media/v4l2-ioctl.h | 55 ++ include/trace/events/v4l2.h | 2 +- include/uapi/linux/videodev2.h | 29 ++ 16 files changed, 718 insertions(+), 135 deletions(-)
Signature · 1 line
2.20.0