You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Hans Verkuil
2fc11536cf
V4L/DVB: videobuf-dma-sg: set correct size in last sg element
...
This fixes a nasty memory corruption bug when using userptr I/O.
The function videobuf_pages_to_sg() sets up the scatter-gather list for the
DMA transfer to the userspace pages. The first transfer is setup correctly
(the size is set to PAGE_SIZE - offset), but all other transfers have size
PAGE_SIZE. This is wrong for the last transfer which may be less than PAGE_SIZE.
Most, if not all, drivers will program the boards DMA engine correctly, i.e.
even though the size in the last sg element is wrong, they will do their
own size calculations and make sure the right amount is DMA-ed, and so seemingly
prevent memory corruption.
However, behind the scenes the dynamic DMA mapping support (in lib/swiotlb.c)
may create bounce buffers if the memory pages are not in DMA-able memory.
This happens for example on a 64-bit linux with a board that only supports
32-bit DMA.
These bounce buffers DO use the information in the sg list to determine the
size. So while the DMA engine transfers the correct amount of data, when the
data is 'bounced' back too much is copied, causing buffer overwrites.
The fix is simple: calculate and set the correct size for the last sg list
element.
Signed-off-by: Hans Verkuil <hans.verkuil@tandberg.com>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
15 years ago
..
davinci
V4L/DVB: V4L: vpfe_capture: Add call back function for interrupt clear for vpfe_cfg
15 years ago
adv7343.h
…
ak881x.h
V4L/DVB: V4L: v4l2-subdev driver for AK8813 and AK8814 TV-encoders from AKM
15 years ago
bt819.h
…
cs53l32a.h
…
cs5345.h
…
cx2341x.h
V4L/DVB: cx2341x: convert to the control framework
15 years ago
cx25840.h
V4L/DVB: cx25840/ivtv: replace ugly priv control with s_config
15 years ago
i2c-addr.h
…
ir-common.h
V4L/DVB: ir-common: remove keymap tables from the module
15 years ago
ir-core.h
V4L/DVB: IR: extend interfaces to support more device settings
15 years ago
ir-kbd-i2c.h
V4L/DVB: ir-core: partially convert ir-kbd-i2c.c to not use ir-functions.c
15 years ago
lirc.h
V4L/DVB: IR: extend interfaces to support more device settings
15 years ago
lirc_dev.h
V4L/DVB: IR/lirc: make lirc userspace and staging modules buildable
15 years ago
m52790.h
…
msp3400.h
…
mt9t112.h
V4L/DVB (13670): soc-camera: Add mt9t112 camera driver
15 years ago
ov772x.h
soc-camera: ov772x: Modify buswidth control
15 years ago
ovcamchip.h
…
pwc-ioctl.h
…
radio-si4713.h
…
rc-map.h
V4L/DVB: staging/lirc: port lirc_streamzap to ir-core
15 years ago
rds.h
…
rj54n1cb0c.h
V4L/DVB (13661): rj54n1cb0c: Add cropping, auto white balance, restrict sizes, add platform data
15 years ago
saa6752hs.h
…
saa7115.h
…
saa7127.h
…
saa7146.h
…
saa7146_vv.h
V4L/DVB: saa7146: fix regression of the av7110/budget-av driver
15 years ago
sh_mobile_ceu.h
V4L/DVB: V4L2: sh_mobile_camera_ceu: add support for CSI2
15 years ago
sh_mobile_csi2.h
V4L/DVB: V4L2: soc-camera: add a MIPI CSI-2 driver for SH-Mobile platforms
15 years ago
sh_vou.h
V4L/DVB: V4L: SuperH Video Output Unit (VOU) driver
15 years ago
si4713.h
…
soc_camera.h
V4L/DVB: V4L2: soc-camera: export soc-camera bus type for notifications
15 years ago
soc_camera_platform.h
V4L/DVB (13659): soc-camera: convert to the new mediabus API
15 years ago
soc_mediabus.h
V4L/DVB (13658): v4l: add a media-bus API for configuring v4l2 subdev pixel and frame formats
15 years ago
timb_radio.h
V4L/DVB: radio: Add radio-timb
15 years ago
tuner-types.h
…
tuner.h
V4L/DVB: tuner: Add a definition for the Philips FQ1236 MK5 NTSC tuner
15 years ago
tvaudio.h
…
tveeprom.h
…
tvp514x.h
…
tvp5150.h
…
tvp7002.h
V4L/DVB: Definitions for TVP7002 in DM365
15 years ago
tw9910.h
tw9910: use TABs for indentation
15 years ago
upd64031a.h
…
upd64083.h
…
v4l2-chip-ident.h
V4L/DVB: V4L: v4l2-subdev driver for AK8813 and AK8814 TV-encoders from AKM
15 years ago
v4l2-common.h
V4L/DVB: v4l2-common: simplify prio utility functions
15 years ago
v4l2-ctrls.h
V4L/DVB: v4l2: Add new control handling framework
15 years ago
v4l2-dev.h
V4L/DVB: v4l2: Add new control handling framework
15 years ago
v4l2-device.h
V4L/DVB: v4l2: Add new control handling framework
15 years ago
v4l2-event.h
V4L/DVB: V4L: Events: Add backend
15 years ago
v4l2-fh.h
V4L/DVB: V4L: Events: Add backend
15 years ago
v4l2-i2c-drv.h
…
v4l2-int-device.h
…
v4l2-ioctl.h
V4L/DVB: V4L: Events: Support event handling in do_ioctl
15 years ago
v4l2-mediabus.h
V4L/DVB: V4L2: mediabus: add 12-bit Bayer and YUV420 pixel formats
15 years ago
v4l2-mem2mem.h
V4L/DVB: add memory-to-memory device helper framework for videobuf
15 years ago
v4l2-subdev.h
V4L/DVB: v4l2: Add new control handling framework
15 years ago
videobuf-core.h
V4L/DVB: videobuf: Remove videobuf_mapping start and end fields
15 years ago
videobuf-dma-contig.h
V4L/DVB (13377): make struct videobuf_queue_ops constant
15 years ago
videobuf-dma-sg.h
V4L/DVB: videobuf-dma-sg: set correct size in last sg element
15 years ago
videobuf-dvb.h
…
videobuf-vmalloc.h
V4L/DVB: videobuf: Rename vmalloc fields to vaddr
15 years ago
wm8775.h
…