From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,T_DKIMWL_WL_HIGH,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C31DCC28CC2 for ; Thu, 30 May 2019 04:59:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9364926022 for ; Thu, 30 May 2019 04:59:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559192363; bh=CbZArB9MKUxnFEC4rTaoIMLibYwBCdr6PxR0TOtiaPE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=EhnLTdPap9N+JREKJt5YSWdRcLd90oj1T5yNHKEinaa9P1L145eN3uwZws6nXaBw+ 8xVxNevlorZ4/L3CtJeA52smEpwCsiaS8RzH4hwm2qke24HRQNdA/4YTKwvyJwWhtr MJQQukRBATJiLx90pl6GupDeOzZyqndNFpNDZ3LI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727694AbfE3DJk (ORCPT ); Wed, 29 May 2019 23:09:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:44612 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727680AbfE3DJj (ORCPT ); Wed, 29 May 2019 23:09:39 -0400 Received: from localhost (ip67-88-213-2.z213-88-67.customer.algx.net [67.88.213.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A81192448E; Thu, 30 May 2019 03:09:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559185778; bh=CbZArB9MKUxnFEC4rTaoIMLibYwBCdr6PxR0TOtiaPE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fpVaH83nR8iqvTq8dAVkSmPEmYAGhiaHePhwaEYhB25tMPC/Rv6sm/RcUVFDRAazt HdltDIcE/CXDE/lnugyymXdx8m+b4nN/Mx+WeelssgcaHjePvCgifvJkgjBxanArGJ DO0ox7pyHKASoUkTn1g49IfZiow7uo2gZI8hR+HY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexander Potapenko , Syzbot , Hans Verkuil , Mauro Carvalho Chehab Subject: [PATCH 5.1 037/405] media: vivid: use vfree() instead of kfree() for dev->bitmap_cap Date: Wed, 29 May 2019 20:00:35 -0700 Message-Id: <20190530030542.645291906@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030540.291644921@linuxfoundation.org> References: <20190530030540.291644921@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Alexander Potapenko commit dad7e270ba712ba1c99cd2d91018af6044447a06 upstream. syzkaller reported crashes on kfree() called from vivid_vid_cap_s_selection(). This looks like a simple typo, as dev->bitmap_cap is allocated with vzalloc() throughout the file. Fixes: ef834f7836ec0 ("[media] vivid: add the video capture and output parts") Signed-off-by: Alexander Potapenko Reported-by: Syzbot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/platform/vivid/vivid-vid-cap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/media/platform/vivid/vivid-vid-cap.c +++ b/drivers/media/platform/vivid/vivid-vid-cap.c @@ -1007,7 +1007,7 @@ int vivid_vid_cap_s_selection(struct fil v4l2_rect_map_inside(&s->r, &dev->fmt_cap_rect); if (dev->bitmap_cap && (compose->width != s->r.width || compose->height != s->r.height)) { - kfree(dev->bitmap_cap); + vfree(dev->bitmap_cap); dev->bitmap_cap = NULL; } *compose = s->r;