From mboxrd@z Thu Jan 1 00:00:00 1970 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=-12.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED 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 9B4B5C43381 for ; Fri, 15 Feb 2019 07:53:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6B4F121872 for ; Fri, 15 Feb 2019 07:53:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550217200; bh=Yy1RUzOA5ND5rbebGiKrFi/dzwesaKFWWcHrNod/EwU=; h=Subject:To:From:Date:List-ID:From; b=IhnwqRfd8J6Or1JoLKVlXK8yNpAqR++52uYbRcynJ95Agz2zc6qWeQgCwc0Nhznoy wFCWHkyJTjRMvArjTLNW81cWNI9+U2aFM2Xn6A744CD3RT/+uG1L+/GLqnZ4P1aOd0 kRyyKSdN7+EPQMrOtA0igMor5S4dCa+1qR45gfbE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726634AbfBOHxQ (ORCPT ); Fri, 15 Feb 2019 02:53:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:38646 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726167AbfBOHxP (ORCPT ); Fri, 15 Feb 2019 02:53:15 -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 070D621920; Fri, 15 Feb 2019 07:53:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550217191; bh=Yy1RUzOA5ND5rbebGiKrFi/dzwesaKFWWcHrNod/EwU=; h=Subject:To:From:Date:From; b=R/VTENevYz1+TQR2pjedoJhgYX0JvgLmMbAVfr32Ho5uJOyC9B1YlGQ750Pf0kvn9 xIYdcRhUZDjUIw8k4JHq0l2mqeRVhmvUeyZ2hXGRx79cbLhQ1wtNr1oW6O2LGswAM5 H5KSYEmPPRbgQKD8x8XaS/tvRqHwznYwfazh03yY= Subject: patch "staging: erofs: fix memleak of inode's shared xattr array" added to staging-next To: shengyong1@huawei.com, gaoxiang25@huawei.com, gregkh@linuxfoundation.org, stable@vger.kernel.org From: Date: Fri, 15 Feb 2019 08:52:56 +0100 Message-ID: <15502171764841@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org This is a note to let you know that I've just added the patch titled staging: erofs: fix memleak of inode's shared xattr array to my staging git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git in the staging-next branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will also be merged in the next major kernel release during the merge window. If you have any questions about this process, please let me know. >From 3b1b5291f79d040d549d7c746669fc30e8045b9b Mon Sep 17 00:00:00 2001 From: Sheng Yong Date: Thu, 14 Feb 2019 14:46:36 +0800 Subject: staging: erofs: fix memleak of inode's shared xattr array If it fails to read a shared xattr page, the inode's shared xattr array is not freed. The next time the inode's xattr is accessed, the previously allocated array is leaked. Signed-off-by: Sheng Yong Fixes: b17500a0fdba ("staging: erofs: introduce xattr & acl support") Cc: # 4.19+ Reviewed-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman --- drivers/staging/erofs/xattr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/staging/erofs/xattr.c b/drivers/staging/erofs/xattr.c index e748df8d2b44..8c48b0ab31fd 100644 --- a/drivers/staging/erofs/xattr.c +++ b/drivers/staging/erofs/xattr.c @@ -111,8 +111,11 @@ static int init_inode_xattrs(struct inode *inode) it.page = erofs_get_meta_page(sb, ++it.blkaddr, S_ISDIR(inode->i_mode)); - if (IS_ERR(it.page)) + if (IS_ERR(it.page)) { + kfree(vi->xattr_shared_xattrs); + vi->xattr_shared_xattrs = NULL; return PTR_ERR(it.page); + } it.kaddr = kmap_atomic(it.page); atomic_map = true; -- 2.20.1