From patchwork Tue Sep 29 10:59:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 291128 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7176CC4727C for ; Tue, 29 Sep 2020 11:39:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 364D9208B8 for ; Tue, 29 Sep 2020 11:39:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601379557; bh=JJUCyPfDfNdMfR68wl70LGUqR0ESBKrg7FR7xp4Y9QU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=DfLcbLZSVbyAnmjjwIv7OETJOU7f5qFyqfou0CWZ6Dd0PEwpqzN0broKnrDzX1nP+ /B6QSII7CNqsOYCX97Llca5zMLjPPbqKtLi85fg1ssxz9NjVuufq6jP176jKUJnmqd Lan87iTMNfIMpTwuF6vxzlgVQh2LrZ5wa+9rjgfs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729933AbgI2LjP (ORCPT ); Tue, 29 Sep 2020 07:39:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:33406 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730450AbgI2LjF (ORCPT ); Tue, 29 Sep 2020 07:39:05 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 F30AC2083B; Tue, 29 Sep 2020 11:39:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601379545; bh=JJUCyPfDfNdMfR68wl70LGUqR0ESBKrg7FR7xp4Y9QU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hn0g3Iqwl93erWc137OZXEnNLxYqJ/g84lOjjydeAjTFY6Wx+Qe5os65zMMsQv4i5 Yhr3frAF4iNHborFiqkASrp2dsHoHMo51uyDaR+63y8R5cXLE2PNuaXWyTwmIh4VI4 LyoaG5AUH+CQO5TlU15xJJNRu51Ldrs5yAJH8mac= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhihao Cheng , Richard Weinberger , Sasha Levin Subject: [PATCH 5.4 211/388] ubifs: ubifs_jnl_write_inode: Fix a memory leak bug Date: Tue, 29 Sep 2020 12:59:02 +0200 Message-Id: <20200929110020.693751299@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929110010.467764689@linuxfoundation.org> References: <20200929110010.467764689@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@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);