diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2011-11-16 15:09:40 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-12-30 16:03:46 -0200 |
commit | f0b7c7fc6f15e823cb4a5d225d9ef28b884ab6ec (patch) | |
tree | a460428bbaf613bc8e209e52fc13b2a6b713a673 /drivers/media/video/videobuf2-core.c | |
parent | 54828d19f82be0d62e22fbd5a6354136c50a20eb (diff) | |
download | op-kernel-dev-f0b7c7fc6f15e823cb4a5d225d9ef28b884ab6ec.zip op-kernel-dev-f0b7c7fc6f15e823cb4a5d225d9ef28b884ab6ec.tar.gz |
[media] media: vb2: fix queueing of userptr buffers with null buffer pointer
Heuristic that checks if the memory pointer has been changed lacked a check
if the pointer was actually provided by the userspace, what allowed one to
queue a NULL pointer which was accepted without further checking. This
patch fixes this issue.
Reported-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Pawel Osciak <pawel@osciak.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/videobuf2-core.c')
-rw-r--r-- | drivers/media/video/videobuf2-core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/video/videobuf2-core.c b/drivers/media/video/videobuf2-core.c index 95a3f5e..4d22b82 100644 --- a/drivers/media/video/videobuf2-core.c +++ b/drivers/media/video/videobuf2-core.c @@ -883,7 +883,8 @@ static int __qbuf_userptr(struct vb2_buffer *vb, const struct v4l2_buffer *b) for (plane = 0; plane < vb->num_planes; ++plane) { /* Skip the plane if already verified */ - if (vb->v4l2_planes[plane].m.userptr == planes[plane].m.userptr + if (vb->v4l2_planes[plane].m.userptr && + vb->v4l2_planes[plane].m.userptr == planes[plane].m.userptr && vb->v4l2_planes[plane].length == planes[plane].length) continue; |