Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp239313ybi; Wed, 29 May 2019 20:25:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxo2PK1y0twtRs0/ltZYEB9BsLSJk3cxQMYQTzGlGR9EPvUX0Vg8RwkzU82ml2qfe1U84Mi X-Received: by 2002:a17:902:8493:: with SMTP id c19mr1700184plo.58.1559186730167; Wed, 29 May 2019 20:25:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559186730; cv=none; d=google.com; s=arc-20160816; b=ExLu/hwxcnVCtC82b5jMLMQUDNgNcP9B3jjNrev8FoSpHcgFRb7B3mIvNQJrN3xbOo zlWuwuu973Q5hnB6U53pCuCPsLTCZxBqwJuq2RTx+cHcxbLamYk7Vp78hOXDlFR4NxcL m7biG9PeSXis1ZGC86KZd74y5grgXkT6OIYdb+puLoQNj5cZKj9LGMwLRq1PRn26/BOa NvaxnOB4w7F8uQv54b3VcdtL/knOME95Ez4N5PZxz9J5fyd772NuZ95soVkGh//QHa/Y ru4bqPyRtiBkVeKL649mcmDWitBXonmcTLkTJEyPYrK8DOT5E4o2o/+JnxMRURdujBKc Aa+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=R62vNkTMcjGVRLYWf0ULXrwbcxPQcd+THRtLjMW2HXk=; b=vfAbx8dn5MiLMudtbVwwrWt+6HUj+Iq39M4k/F2NuKVJ8+eR7CIvc6VIYO3EMwWgiL H1JwFHDSKNhINJ+1NKMaqMh2FYvX+jcEgMmvBBIuMFuMq6iks37YCZVyBISBC7g2BB5b sMXSOSOBZK81TPMwhqtWtzw2ciIngX2xQwyt4BYF0OJAdV7FGgBEqg5A9hsaCNWsloEM f6XfeZkNp0sKHdoCOE6bAGL5Jai+OThyBF3X4Ws3kMtUfIeM21L+N3v4fV980nVJe2n0 +xFChM+QF6WNZsH4fTgLbudzMRQf+QYz/5eX/SIqbG1R6KqfzSXtF6hww1IX1Nsvo9Wb 4cNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kb0PPyox; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k21si1735476pll.425.2019.05.29.20.25.14; Wed, 29 May 2019 20:25:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kb0PPyox; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732831AbfE3DWS (ORCPT + 99 others); Wed, 29 May 2019 23:22:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:43280 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730768AbfE3DQl (ORCPT ); Wed, 29 May 2019 23:16:41 -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 5D8DA24615; Thu, 30 May 2019 03:16:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559186201; bh=qktqclC8CUNFS+QMgcn1eVaCPnx95DfSItL9pLqdykw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kb0PPyox63m3JgFC7fTIxJ9ew74TkMoowgDffRuhiPYXEGB8PnQiyEZC9ARFZ3x/S 81jNSlMzvaVtNiextlFmDxIc6TuVubtcf5ouueTePJFgWLFXIwNiyeMtoq+H9IqpCW XEA9czTo5JlHsIzIDwHZo4/rjCrZNDaKpMDU8160= 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.19 037/276] media: vivid: use vfree() instead of kfree() for dev->bitmap_cap Date: Wed, 29 May 2019 20:03:15 -0700 Message-Id: <20190530030526.556157459@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030523.133519668@linuxfoundation.org> References: <20190530030523.133519668@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 @@ -992,7 +992,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;