Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2958772imu; Mon, 19 Nov 2018 08:37:56 -0800 (PST) X-Google-Smtp-Source: AJdET5cH8+CkSItovTQZR0poGpZr5xPsAWehSEaaMniJFz0tr1v3Dk6LNEw+78YiN5kJysgfoIMt X-Received: by 2002:a17:902:2ac3:: with SMTP id j61mr23029964plb.185.1542645476842; Mon, 19 Nov 2018 08:37:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542645476; cv=none; d=google.com; s=arc-20160816; b=FlSlIZWiLO32aD3Rz3qUTFBCvRhzn/REHKfDS6bpTF+Am1UgVl25hrWmI3JAV5kD2z u4fvrpYJR2Y4XX1abnzZbFPGI+XfKF7IyPDnUUTA+Foo2KMQj7gqDyyJkmg1XJHyhE7g 5acQBMorO1fxT9o/hYEBhqYc2uljhS3XD22oRvGf3mCpXwccMICCpJLIqhqXPSfPByr3 VNM8ChmWB8dBr9UsHqm7fSotgD1IggzHWt24e3x0/G/atYFFGyt9WJ84P3uq5DhMcugJ 6SuynimMiByLSV6gLAD6UxNkOWd2YyEoydyOutPqEgzhcmFLuU0b1X1G/kLeVuFbbKt/ Nx7w== 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=jVDj4iP0Z/5NoqzR6KEdKEGOzqdsJN8EAYmoH+SBss8=; b=T+BqMxWAOGfOni3mbYF6v8JtSL4nxZ7H5CNVobL7nnvl3fS00MdXMks1WG0OmqR13E NAK9PLBZgUhhXQcA4wP3zHvfuH6u+k050PaSJgQPQP7bGI98Z5v4/KuAeza82oJZ1uBI X2UW1V30av149w0EfCzKoY4XcUKpQBj1q2iYyTKurb0Iw1Hm8lx4DKPkPeFeSlMFWJIe vT06aiKoHzTW2ZjN5tQoxT0GWK5TJphzQZ+esCPues+puAcxFB5VXreoHO9BQmHNQ10V 7adbyzhaeYEvhvmcCaCILiPCFAykDEzsjEMov/MXpuzLts7oYKejeEqj3jgKKSWXWvKj zM8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xeoAUtdF; 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 207si601036pfz.249.2018.11.19.08.37.41; Mon, 19 Nov 2018 08:37:56 -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=xeoAUtdF; 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 S1731871AbeKTDAX (ORCPT + 99 others); Mon, 19 Nov 2018 22:00:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:60200 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730366AbeKTDAW (ORCPT ); Mon, 19 Nov 2018 22:00:22 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 55EB22086A; Mon, 19 Nov 2018 16:36:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542645373; bh=6KrNInXbjiXqhIDu41r04Z2CyhSI0dIRIUb1U2iZHaY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xeoAUtdFWjkVtuTarWtX+Mvh70I2sTGOBAzJQTPg5hekKR4YXBXJa2W2dyGu0bx/b ovoGd8bt92pvCjaOw4F7acwVV2PXa/ZvKyU1tOcrYhIAQt0bSF4A4Xt0YKNdtigBi1 ZRXeb6GlZtdnpWhR1uBSKlL0eiKcYu0uAMUug3ug= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Monakhov , Vasily Averin , Theodore Tso , stable@kernel.org Subject: [PATCH 4.19 137/205] ext4: avoid buffer leak in ext4_orphan_add() after prior errors Date: Mon, 19 Nov 2018 17:27:24 +0100 Message-Id: <20181119162637.545051752@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181119162616.586062722@linuxfoundation.org> References: <20181119162616.586062722@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Vasily Averin commit feaf264ce7f8d54582e2f66eb82dd9dd124c94f3 upstream. Fixes: d745a8c20c1f ("ext4: reduce contention on s_orphan_lock") Fixes: 6e3617e579e0 ("ext4: Handle non empty on-disk orphan link") Cc: Dmitry Monakhov Signed-off-by: Vasily Averin Signed-off-by: Theodore Ts'o Cc: stable@kernel.org # 2.6.34 Signed-off-by: Greg Kroah-Hartman --- fs/ext4/namei.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -2811,7 +2811,9 @@ int ext4_orphan_add(handle_t *handle, st list_del_init(&EXT4_I(inode)->i_orphan); mutex_unlock(&sbi->s_orphan_lock); } - } + } else + brelse(iloc.bh); + jbd_debug(4, "superblock will point to %lu\n", inode->i_ino); jbd_debug(4, "orphan inode %lu will point to %d\n", inode->i_ino, NEXT_ORPHAN(inode));