Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1168599pxy; Fri, 23 Apr 2021 01:42:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoBhwMbTfVSjF4cq/pXP2SzLChmAJXahJZ7AB/Ujla4K2xpSvW7rlP/7y9lY0PeUP+9fn5 X-Received: by 2002:a63:814a:: with SMTP id t71mr2754895pgd.427.1619167344196; Fri, 23 Apr 2021 01:42:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619167344; cv=none; d=google.com; s=arc-20160816; b=AGN9/wJ3cQ970jQpCuJj1seh2/MdJwU2BvTa4LT3Kol3IYIrPm0c4XlmLVF9APxBAq QYFlBQKPEL1uxlIIASz2LAzaSZYlza/76AK7rTF225dTPY3qftd0j3MoYAOY+aEwWAff iY4iYSCot/8ZUUqN3oDtQUxvfQzYEHlbd+OSOIHS9IRv0CcHg0ONpcZMrM0As+7zyD3C xxiKEODVlOK4Yi/dC6YtoVTWktHo34oe8/FHELv7DUqIlMj2vcZfHxJuh7TErmgwp6zz jmK5QMqmlGZTMnGqxVNCsWxRjYrA1MxBn7h1h3oPQCWPAWI4nPLqT5MpiKehh6cbPTg1 PolQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:ironport-hdrordr; bh=WsNMRtcD29Sjl71wT0x9UCAmPEAW+nlBWlDFSpXOK1U=; b=YyGvgkUW9VouKpwtkwAdglwWM0K/9sVN5Ibf9VdBcD4R6vUxiiUmV8KmBRfCw8EUTE qaY/IGg5loHMOq/h8eEmzoyqjvTNrS/SIgN/oOkTiHYkQ1JxV2d0Rf+2jAGHWwlXAZut wxKIH6FvoQBpqsFCF/Nq5dMPY7Eceez6QMCKtp9ZVz+7opH151Jvq/6cauj6Yuwed2dA Bt+dDmaRBCC8z7WQ8Ar+gkrtvInagmaj86mfJJgxRE5uC53dMAS4KqWUneUzQmxjvtEw cp1iP2lUJ0lulMnmxiRt+qy89d2LByX+pcX5gQBDt6QTZ1siRRmqn0Dj341/dfrs5yae GX6Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w18si6547795plq.286.2021.04.23.01.42.10; Fri, 23 Apr 2021 01:42:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230191AbhDWImK (ORCPT + 99 others); Fri, 23 Apr 2021 04:42:10 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:17534 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230007AbhDWImK (ORCPT ); Fri, 23 Apr 2021 04:42:10 -0400 IronPort-HdrOrdr: =?us-ascii?q?A9a23=3A4G2ug6stEWm5EsPGI2AcM+bn7skDl9V00zAX?= =?us-ascii?q?/kB9WHVpW+afkN2jm+le6A/shF8qKRUdsP2JJaXoexjh3LFv5415B92fdSng/F?= =?us-ascii?q?ClNYRzqbblqgeAJwTb1spwkZhtaLJ/DtqYNykese/f7BOjG9gthPmrmZrJuc7k?= =?us-ascii?q?w31gTR5nZshbhm9EIz2WHUFsSA5NCYBRLuv+2uN8uzGidX4LB/7UOlA5WYH4y+?= =?us-ascii?q?HjqIjrelovCRIh9WC1/FGVwY+/Ilyj0hASXygn+9of2GLO+jaX2pme?= X-IronPort-AV: E=Sophos;i="5.82,245,1613430000"; d="scan'208";a="379461705" Received: from 173.121.68.85.rev.sfr.net (HELO hadrien) ([85.68.121.173]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Apr 2021 10:41:32 +0200 Date: Fri, 23 Apr 2021 10:41:32 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Krzysztof Kozlowski cc: Hans Verkuil , Mauro Carvalho Chehab , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Qiushi Wu Subject: Re: [PATCH 009/190] Revert "media: s5p-mfc: Fix a reference count leak" In-Reply-To: Message-ID: References: <20210421130105.1226686-1-gregkh@linuxfoundation.org> <20210421130105.1226686-10-gregkh@linuxfoundation.org> <20210423100727.5a999c2e@coco.lan> <02966f20-342d-cf21-8216-d364b67753b7@xs4all.nl> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 23 Apr 2021, Krzysztof Kozlowski wrote: > On 23/04/2021 10:10, Hans Verkuil wrote: > > On 23/04/2021 10:07, Mauro Carvalho Chehab wrote: > >> Em Fri, 23 Apr 2021 09:10:32 +0200 > >> Greg Kroah-Hartman escreveu: > >> > >>> On Fri, Apr 23, 2021 at 09:04:27AM +0200, Krzysztof Kozlowski wrote: > >>>> On 21/04/2021 14:58, Greg Kroah-Hartman wrote: > >>>>> This reverts commit 78741ce98c2e36188e2343434406b0e0bc50b0e7. > >>>>> > >>>>> Commits from @umn.edu addresses have been found to be submitted in "bad > >>>>> faith" to try to test the kernel community's ability to review "known > >>>>> malicious" changes. The result of these submissions can be found in a > >>>>> paper published at the 42nd IEEE Symposium on Security and Privacy > >>>>> entitled, "Open Source Insecurity: Stealthily Introducing > >>>>> Vulnerabilities via Hypocrite Commits" written by Qiushi Wu (University > >>>>> of Minnesota) and Kangjie Lu (University of Minnesota). > >>>>> > >>>>> Because of this, all submissions from this group must be reverted from > >>>>> the kernel tree and will need to be re-reviewed again to determine if > >>>>> they actually are a valid fix. Until that work is complete, remove this > >>>>> change to ensure that no problems are being introduced into the > >>>>> codebase. > >>>>> > >>>>> Cc: Qiushi Wu > >>>>> Cc: Hans Verkuil > >>>>> Cc: Mauro Carvalho Chehab > >>>>> Signed-off-by: Greg Kroah-Hartman > >>>>> --- > >>>>> drivers/media/platform/s5p-mfc/s5p_mfc_pm.c | 4 +--- > >>>>> 1 file changed, 1 insertion(+), 3 deletions(-) > >>>>> > >>>> > >>>> This looks like a good commit but should be done now in a different way > >>>> - using pm_runtime_resume_and_get(). Therefore I am fine with revert > >>>> and I can submit later better fix. > >>> > >>> Great, thanks for letting me know, I can have someone work on the > >>> "better fix" at the same time. > >> > >> IMO, it is better to keep the fix. I mean, there's no reason to > >> revert a fix that it is known to be good. > >> > >> The "better fix" patch can be produced anytime. A simple coccinelle > >> ruleset can replace patterns like: > >> > >> ret = pm_runtime_get_sync(pm->device); > >> if (ret < 0) { > >> pm_runtime_put_noidle(pm->device); > >> return ret; > >> } > >> > >> and the broken pattern: > >> > >> ret = pm_runtime_get_sync(pm->device); > >> if (ret < 0) > >> return ret; > >> > >> to: > >> > >> ret = pm_runtime_resume_and_get(pm->device); > >> if (ret < 0) > >> return ret; > > > > That's my preference as well. > > It won't be that easy because sometimes the error handling is via goto > (like in other patches here) but anyway I don't mind keeping the > original commits. I tried the following semantic patch: @@ expression ret,e; @@ - ret = pm_runtime_get_sync(e); + ret = pm_resume_and_get(e); if (ret < 0) { ... ?- pm_runtime_put_noidle(e); ... return ret; } It has the following features: * The ? means that if pm_runtime_put_noidle is absent, the transformation will happen anyway. * The ... before the return means that the matching will jump over a goto. It makes a lot of changes (in a kernel I had handy from March). This is a complicated API, however, and I don't know if there are any other issues to take into account, especially in the case where the call to pm_runtime_put_noidle is not present. julia