media: videobuf2: Assert held reservation lock for dma-buf mmapping
authorDmitry Osipenko <dmitry.osipenko@collabora.com>
Thu, 10 Nov 2022 20:13:48 +0000 (23:13 +0300)
committerDmitry Osipenko <dmitry.osipenko@collabora.com>
Fri, 11 Nov 2022 20:49:53 +0000 (23:49 +0300)
commit3a6ca1810f774ceed129683d8f8c9721c03512b0
treeba266809e4f8624be158c7ad75e02d9b133de903
parent27f3733a104950169797407fea330a2e1d42f16b
media: videobuf2: Assert held reservation lock for dma-buf mmapping

When userspace mmaps dma-buf's fd, the dma-buf reservation lock must be
held. Add locking sanity checks to the dma-buf mmaping callbacks to ensure
that the locking assumptions won't regress in the future.

Suggested-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Acked-by: Tomasz Figa <tfiga@chromium.org>
Acked-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221110201349.351294-6-dmitry.osipenko@collabora.com
drivers/media/common/videobuf2/videobuf2-dma-contig.c
drivers/media/common/videobuf2/videobuf2-dma-sg.c
drivers/media/common/videobuf2/videobuf2-vmalloc.c