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 B2F88C072B1 for ; Thu, 30 May 2019 03:55:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8270824E7D for ; Thu, 30 May 2019 03:55:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559188554; bh=CbZArB9MKUxnFEC4rTaoIMLibYwBCdr6PxR0TOtiaPE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=gIS4lVQSj6hpIKEGJC4PtB1AoT7buoCJNIj+CiDjlMLp2Wp30TrTa2MYAx/bf+2FC Uc+JWlPqUS1DtiyhLLS6ROPtpBASaUzx/4chXlGavqvaAwAsdRtxXUBubIO88Di2Ne p1O8nA2bJBCD1vlSyLwcbStm+5e42DpQDUUJBnYs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727505AbfE3DTH (ORCPT ); Wed, 29 May 2019 23:19:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:53690 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731795AbfE3DTF (ORCPT ); Wed, 29 May 2019 23:19:05 -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 7E3FF247DE; Thu, 30 May 2019 03:19:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559186344; bh=CbZArB9MKUxnFEC4rTaoIMLibYwBCdr6PxR0TOtiaPE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xrt+dY5PX9e3doxMZ/D+4SywZh7NG6M6OxUwCgGY2l5EYeqPH7RS/rdBW4wDeI392 m8eaPPbIkqLmSGsuq6Ij3pxVjGfZI1oYJJfhKWJKWVdhr9GD3kt4hL3twmgnJ8Aw1e gNGf1tjuNMwnPkmKvCo8yvniXEz4/Il6iwyzHJ3s= 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 4.14 029/193] media: vivid: use vfree() instead of kfree() for dev->bitmap_cap Date: Wed, 29 May 2019 20:04:43 -0700 Message-Id: <20190530030453.307154276@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030446.953835040@linuxfoundation.org> References: <20190530030446.953835040@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;