Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3465214ybg; Fri, 25 Oct 2019 04:39:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqyUoxO/u0Ue3tbUCvpjXqpCH49r1WHtcqHeHPFRVPIgWba6twhRG8Q4prk6+Lp0tM8OG3pv X-Received: by 2002:a17:906:6011:: with SMTP id o17mr2900265ejj.172.1572003543256; Fri, 25 Oct 2019 04:39:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572003543; cv=none; d=google.com; s=arc-20160816; b=NZrdl3vuCbO6M+BHFdR/LrTR/UbYKMRkQ//cBvlYVWcCRdDTsKutjMOV1K/wSUASqu 9zKH1Tx0tx8uH5rqm2RmfmmaMI93M5LjkoROh0q4Ge+tyHPW6lDqtuQIvO3TcStqbrY3 zoReeiNTHw1XAzZp0xCMXaQv2MfrePQ+/gFRFU+uEpwLEzk3nDEfs/EcCdW5lIe9h4ht fY2iuJKxMDagZsoyskxFlJheO09/DJ3eychpH3va3d7+3d4DnwTj8jQ4IFz0z5+6KlBy 57E71nRN3eswl7BYVnp9MJxCTLWxpkdN9RmfunW/BGD/eh6ROBn9x2aJiat51hIG/WJh j7nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=PyaL5FR9d/jZB2FfWAIqD9mvnFhdj/C8GIiTAS5nB5E=; b=Nik7SkTPicqHZKd4kW3tdRCm1kv4InQd01x2Xwuy+uDAFnrgOr40/HsDAF2P2RwRQk k495owQdswXNmhCQnhXN2hntUYLUYH5oaU7l/AI9zGZJgkqJWMzi/wQgVhsSKcRfTpe2 ZirkYWaUiBkuUwnMQhf9s8ki3td4ssJhbXCmsiOLznCQMf6qQqhzBWqaFVM+YnffkR3+ u/VIof7ei08um8WZ7otvquWIZaEEV9mAVpFiIHcqLboMNh1xUBaA7yM4x3P6hTrXbu1a rWSbiBkfLgZ5njsm2bkfFdJlvJ8aQF8JJgnpw9WYhk/si3MAfplU+i1y1aKdxsNhVg8S dP9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=Ce2z1v+k; 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 y40si1026227edd.383.2019.10.25.04.38.39; Fri, 25 Oct 2019 04:39:03 -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=@ffwll.ch header.s=google header.b=Ce2z1v+k; 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 S2502129AbfJXMtt (ORCPT + 99 others); Thu, 24 Oct 2019 08:49:49 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:34877 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2502121AbfJXMts (ORCPT ); Thu, 24 Oct 2019 08:49:48 -0400 Received: by mail-ot1-f67.google.com with SMTP id z6so20542490otb.2 for ; Thu, 24 Oct 2019 05:49:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PyaL5FR9d/jZB2FfWAIqD9mvnFhdj/C8GIiTAS5nB5E=; b=Ce2z1v+kSoWNglTt3WTllLp6U0xvVrQ58wmZZsFzSkJD2t3+lWNZy085pZDtxpY+zJ rUcaX977WLwXD5060KJzO2dq3EKxq+VND5w7OMOxURBBF+OASxA/W2pSivJdHp+2QiQp +cFIcuPS1SLujURbUtaSktkgsNnlh5lM3TVFM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PyaL5FR9d/jZB2FfWAIqD9mvnFhdj/C8GIiTAS5nB5E=; b=brI76p/xzs/u3typkjHDndoaApLBLBvvx98tyfQEKgRfhXHDEcc9novAky/6DjTa6t /4WKxo4+gkBE4XfkHUHajMMUvrDCr88fqNAdhf9edw5rvFs1VDnotrpSbq4OswG9RjLE kzyabcXpu/JBnKWsiQwUPWx/+B0V+cL8PajEbezQU4vzpt0H/qgPvpwm/G9ljhpGUSEJ VqC9czEF1LMQI1clyTgAAQfnDGCuT2jJXtGU/yEwRecs5R8pOiJEzHNo6JSlyL8Ma25u gDrDKxkdsEHcUQApHCv962jhU6aK2Y5syccCuSRNB1OgVvNmjYbgdlyEwuqteFnGsJdi tcNQ== X-Gm-Message-State: APjAAAUbZ2xmhujqmMsGMg9elsqKsoFBoeSGa2cG6iatCnfIt1VR44EH +ohtBwgK2UoM89l6GGMj5zZ0lj1hYZpmBwQOAOxIST6f X-Received: by 2002:a9d:b92:: with SMTP id 18mr12068647oth.188.1571921387385; Thu, 24 Oct 2019 05:49:47 -0700 (PDT) MIME-Version: 1.0 References: <20191024104801.3122-1-colin.king@canonical.com> <20191024123853.GH11828@phenom.ffwll.local> <821f0799-1f37-c853-d2c6-dd95883e02d8@canonical.com> In-Reply-To: <821f0799-1f37-c853-d2c6-dd95883e02d8@canonical.com> From: Daniel Vetter Date: Thu, 24 Oct 2019 14:49:36 +0200 Message-ID: Subject: Re: [PATCH][next] drm/v3d: fix double free of bin To: Colin Ian King , Stephen Rothwell , Sean Paul , Maxime Ripard , Maarten Lankhorst Cc: Eric Anholt , David Airlie , Navid Emamdoost , Iago Toral Quiroga , dri-devel , kernel-janitors@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 24, 2019 at 2:43 PM Colin Ian King wrote: > > On 24/10/2019 13:38, Daniel Vetter wrote: > > On Thu, Oct 24, 2019 at 11:48:01AM +0100, Colin King wrote: > >> From: Colin Ian King > >> > >> Two different fixes have addressed the same memory leak of bin and > >> this now causes a double free of bin. While the individual memory > >> leak fixes are fine, both fixes together are problematic. > >> > >> Addresses-Coverity: ("Double free") > >> Fixes: 29cd13cfd762 ("drm/v3d: Fix memory leak in v3d_submit_cl_ioctl") > >> Fixes: 0d352a3a8a1f (" rm/v3d: don't leak bin job if v3d_job_init fails.") > >> Signed-off-by: Colin Ian King > > > > That sounds like wrong merge resolution somewhere, and we don't have those > > patches merged together in any final tree yet anywhere. What's this based > > on? > > -Daniel > > linux-next Ok adding Stephen. There's a merge conflict between drm-misc-fixes and drm-next (I think) and the merge double-added the kfree(bin). See above for the relevant sha1. Dave is already on here as a heads-up, but also adding drm-misc maintainers. Cheers, Daniel > > Colin > > > >> --- > >> drivers/gpu/drm/v3d/v3d_gem.c | 1 - > >> 1 file changed, 1 deletion(-) > >> > >> diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c > >> index 549dde83408b..37515e47b47e 100644 > >> --- a/drivers/gpu/drm/v3d/v3d_gem.c > >> +++ b/drivers/gpu/drm/v3d/v3d_gem.c > >> @@ -568,7 +568,6 @@ v3d_submit_cl_ioctl(struct drm_device *dev, void *data, > >> ret = v3d_job_init(v3d, file_priv, &bin->base, > >> v3d_job_free, args->in_sync_bcl); > >> if (ret) { > >> - kfree(bin); > >> v3d_job_put(&render->base); > >> kfree(bin); > >> return ret; > >> -- > >> 2.20.1 > >> > > > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch