From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gerd Hoffmann Subject: [PATCH v3 3/3] udmabuf: check that flags has no unsupported bits set Date: Wed, 12 Sep 2018 08:33:16 +0200 Message-ID: <20180912063316.21047-4-kraxel@redhat.com> References: <20180912063316.21047-1-kraxel@redhat.com> Return-path: In-Reply-To: <20180912063316.21047-1-kraxel@redhat.com> Sender: linux-kernel-owner@vger.kernel.org To: dri-devel@lists.freedesktop.org Cc: laurent.pinchart@ideasonboard.com, daniel@ffwll.ch, Gerd Hoffmann , Sumit Semwal , "open list:DMA BUFFER SHARING FRAMEWORK" , "moderated list:DMA BUFFER SHARING FRAMEWORK" , open list List-Id: dri-devel@lists.freedesktop.org Signed-off-by: Gerd Hoffmann Reported-by: Yann Droneaud --- drivers/dma-buf/udmabuf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c index 964beadd11..acd97670c5 100644 --- a/drivers/dma-buf/udmabuf.c +++ b/drivers/dma-buf/udmabuf.c @@ -128,6 +128,9 @@ static long udmabuf_create(const struct udmabuf_create_list *head, int seals, ret = -EINVAL; u32 i, flags; + if (head->flags & ~UDMABUF_FLAGS_CLOEXEC) + return -EINVAL; + ubuf = kzalloc(sizeof(*ubuf), GFP_KERNEL); if (!ubuf) return -ENOMEM; -- 2.9.3