Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp768229ybl; Wed, 11 Dec 2019 07:14:25 -0800 (PST) X-Google-Smtp-Source: APXvYqyE5jAh2oimX+MUeE8BOdqraW0Q2KjzUmQQyzf5AFZneISoy+QEABj8sP6NY11RZqZje0Tm X-Received: by 2002:aca:5582:: with SMTP id j124mr2277960oib.20.1576077265512; Wed, 11 Dec 2019 07:14:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576077265; cv=none; d=google.com; s=arc-20160816; b=rIqngfqh7DhvXO8aC83IJ5hetW5ht+tnRRWzrEDXo6ayH6Nt6ailetNfL0bzRiDoIK /5MhXoujeNjUlMV2vNDD1Hh1dLMLr0ZZmgWmueFGjVeGVo/RhbPnqeBJ2VuE3WXIe1F4 vRMqF4e8deDCr1KHWSSFMYpCsHTA//xbWY6k6QqcTAv46vyWgdD5DwfIaBu+vOgYj/4J AQn7sv9VimGVegUJ7xsyJjxpXppvykF17FpoxYVcRf4ThWXOdsZ31XIrZI/UDhbw9hCJ 9fxAuQkZeZ/7u+ELaXKoNeeVTemNP/2Uvyj0VbeO3QkO6YuqEp8Y15X6VHSlgF/qMN8g UI5A== 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=jcd+NIBnMbYYB1EEkA53BTlZgMtsc6jhpm6XWhj/Ktw=; b=t3i62jclwp7aOGDKevyC5GPWJZtjI43CptJZnYOm4XvSG+Biy2F9z0Paec1iEk6ooR mynD+MKb9i8qWZDJ4FwOjl73OGg2nHYm2bb7h/fe2jgoZd9Dnzw5qIGCFqUz/wUyDikQ grdFu9JT1FT4CmCpr0JzAB4UtXmK6/+xiEgXw1vwBR9xuZ1nz6tLPpnk80fWbRF8d85H Yv1OD84LSxrknMs2jdR8b0p1Ou3eGaDoW0hU62KROrZHukpj+i+54Er9qELaFjO59UJ3 EV71XDNi5Oi3veYVcgYJTtQMp0LRd1oV1cGhwSkf1G54c03/ODhm3hdzwa8xnIA+cm9L WOHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UoLEAcAe; 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 p28si1330605oth.296.2019.12.11.07.14.12; Wed, 11 Dec 2019 07:14:25 -0800 (PST) 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=UoLEAcAe; 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 S1730991AbfLKPLy (ORCPT + 99 others); Wed, 11 Dec 2019 10:11:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:60580 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730036AbfLKPLs (ORCPT ); Wed, 11 Dec 2019 10:11:48 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 04ACD208C3; Wed, 11 Dec 2019 15:11:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576077108; bh=NGnFn9nHpuHhYGvP9pAM7mshyTnwuL5ajlVrjkVg0OU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UoLEAcAeGBBgJcrnVt9G1AX4ONE2snadu84rskyua0SLN1NLAEjt5EZtiTrNKEYBJ 5x95Q7X4SEWEyA+eUL/hl0bxkBXIjrsEpMN56YdFxJ7Cdrdf2FdivmzCuYW9JoMzjW EwvN3gMkU9tChFIOoLaGAA+DHzh0IxYv8tDU7l6o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thibaut Sautereau , Al Viro , Sasha Levin Subject: [PATCH 5.3 020/105] cgroup: dont put ERR_PTR() into fc->root Date: Wed, 11 Dec 2019 16:05:09 +0100 Message-Id: <20191211150226.742272740@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191211150221.153659747@linuxfoundation.org> References: <20191211150221.153659747@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: Al Viro [ Upstream commit 630faf81b3e61bcc90dc6d8b497800657d2752a5 ] the caller of ->get_tree() expects NULL left there on error... Reported-by: Thibaut Sautereau Signed-off-by: Al Viro Signed-off-by: Sasha Levin --- kernel/cgroup/cgroup.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index 8be1da1ebd9a4..f23862fa15146 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -2119,11 +2119,12 @@ int cgroup_do_get_tree(struct fs_context *fc) nsdentry = kernfs_node_dentry(cgrp->kn, sb); dput(fc->root); - fc->root = nsdentry; if (IS_ERR(nsdentry)) { - ret = PTR_ERR(nsdentry); deactivate_locked_super(sb); + ret = PTR_ERR(nsdentry); + nsdentry = NULL; } + fc->root = nsdentry; } if (!ctx->kfc.new_sb_created) -- 2.20.1