Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp877205pxk; Thu, 17 Sep 2020 20:05:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpZb58mLUwzAqaEToq9COv9g+rhH1LnpuunFCZonnXX5jUiLLRpgDQszRYLqLAZcbRBKzE X-Received: by 2002:a17:906:7c4c:: with SMTP id g12mr521927ejp.306.1600398300636; Thu, 17 Sep 2020 20:05:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600398300; cv=none; d=google.com; s=arc-20160816; b=GGAC5JHBXU5amRX5YqpG0Zi38UM/xKwLhg6xhfYSd2qWK36a92UQt0y16o6QGqNqII wL5ljKBjSe8DWbcOlvTN0OoePf7wiTBkLgcf435rQSAs3x+tTyMoehMr60RNwIo25OiI pN5DFTHnnNqrGD8c2HhFT3+B0DQ/D5lTtRZO6MGJhlITsrD9Br+pGPTfuQVTyc9sO48D H0rRnwNiXpbKnBCeXEp4J2DpzINPg1Z0nb76SDjrpVS4OxAEzLIzn8Vt7GXBJpp8UEbY 1coLvMKgJIEAf3BC1N5LpHV6qYYuaRavdJBU7mOEjzrRR2bzl4xqgffluK/2j3ig0p9e +E5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DyITWx9oDb83sZx4eth/DxffaJKxLpPY/EQc/SiCWkA=; b=ZKhc+bIVFcwB423ZrRLZrz3p9F2ouLs6d4N7T6KQN/onuS0aW4mxmfic6Ni00cIsbr FeIWWoPjR1CMH33wAE4TTl1YDj6KL75MZkjQ/WaSMzr9jkQ90xt5VdknhHO78AEakQEr A21g/pXjJW2bP7L0DRQmVRwYIpUBAv+/6XEbjW7pvhNTY6r6WKAc7uGDFd90NXMGzUv8 U2Q2O3uoqmEhRJcDidFX1+jvRgjSygDJsNP8/Wpc5M3EsBu3NaLdTjND5JQWnmrE4wvX v2lUoFtGt6paYzfcg9Lu/v6LrUGnhAM/swTNQtSrdpf1aXz/eSFjFK9qfc50r/00V6lr yjFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sChtpbih; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r2si1130027edc.25.2020.09.17.20.04.37; Thu, 17 Sep 2020 20:05:00 -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; dkim=pass header.i=@kernel.org header.s=default header.b=sChtpbih; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730457AbgIRDAc (ORCPT + 99 others); Thu, 17 Sep 2020 23:00:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:53976 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727571AbgIRCFh (ORCPT ); Thu, 17 Sep 2020 22:05:37 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F33572388E; Fri, 18 Sep 2020 02:05:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394736; bh=JJUCyPfDfNdMfR68wl70LGUqR0ESBKrg7FR7xp4Y9QU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sChtpbih4Yzua+DWk2RvrEebOODtIJfNHhpcqN0P9NJ5SWVP2r68KCPDaX0j/OV6Z n3mNAjCoe6Hf6u9wjpaYM3xWjPSoH9mCS0ls+utXGl7MoEYcQt6VXLVhmsWAZWkjk3 3uDnMzl7MnLFl+xapM1VFwlxtKPAx3NbWVSR9kyo= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Zhihao Cheng , Richard Weinberger , Sasha Levin , linux-mtd@lists.infradead.org Subject: [PATCH AUTOSEL 5.4 217/330] ubifs: ubifs_jnl_write_inode: Fix a memory leak bug Date: Thu, 17 Sep 2020 21:59:17 -0400 Message-Id: <20200918020110.2063155-217-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhihao Cheng [ Upstream commit 81423c78551654953d746250f1721300b470be0e ] When inodes with extended attributes are evicted, xent is not freed in one exit branch. Signed-off-by: Zhihao Cheng Fixes: 9ca2d732644484488db3112 ("ubifs: Limit number of xattrs per inode") Signed-off-by: Richard Weinberger Signed-off-by: Sasha Levin --- fs/ubifs/journal.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c index a6ae2428e4c96..5f2ac5ef0891e 100644 --- a/fs/ubifs/journal.c +++ b/fs/ubifs/journal.c @@ -906,6 +906,7 @@ int ubifs_jnl_write_inode(struct ubifs_info *c, const struct inode *inode) ubifs_err(c, "dead directory entry '%s', error %d", xent->name, err); ubifs_ro_mode(c, err); + kfree(xent); goto out_release; } ubifs_assert(c, ubifs_inode(xino)->xattr); -- 2.25.1