Re: [PATCH 038/190] Revert "cpuidle: Fix three reference count leaks"

Greg Kroah-Hartman
2021-04-27T16:38:45Z

On Wed, Apr 21, 2021 at 07:53:46PM +0200, Rafael J. Wysocki wrote:
> On 4/21/2021 2:58 PM, Greg Kroah-Hartman wrote:
> > This reverts commit c343bf1ba5efcbf2266a1fe3baefec9cc82f867f.
> >
> > 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 <wu000273@umn.edu>
> > Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
>
> > ---
> > drivers/cpuidle/sysfs.c | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c
> > index 53ec9585ccd4..23a219cedbdb 100644
> > --- a/drivers/cpuidle/sysfs.c
> > +++ b/drivers/cpuidle/sysfs.c
> > @@ -487,7 +487,7 @@ static int cpuidle_add_state_sysfs(struct cpuidle_device *device)
> > ret = kobject_init_and_add(&kobj->kobj, &ktype_state_cpuidle,
> > &kdev->kobj, "state%d", i);
> > if (ret) {
> > - kobject_put(&kobj->kobj);
> > + kfree(kobj);
> > goto error_state;
> > }
> > cpuidle_add_s2idle_attr_group(kobj);
> > @@ -618,7 +618,7 @@ static int cpuidle_add_driver_sysfs(struct cpuidle_device *dev)
> > ret = kobject_init_and_add(&kdrv->kobj, &ktype_driver_cpuidle,
> > &kdev->kobj, "driver");
> > if (ret) {
> > - kobject_put(&kdrv->kobj);
> > + kfree(kdrv);
> > return ret;
> > }
> > @@ -712,7 +712,7 @@ int cpuidle_add_sysfs(struct cpuidle_device *dev)
> > error = kobject_init_and_add(&kdev->kobj, &ktype_cpuidle, &cpu_dev->kobj,
> > "cpuidle");
> > if (error) {
> > - kobject_put(&kdev->kobj);
> > + kfree(kdev);
> > return error;
> > }
>
>

This looks correct so I'll drop the revert.

greg k-h