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=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS 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 86D68C43381 for ; Thu, 7 Mar 2019 17:26:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 596A62081B for ; Thu, 7 Mar 2019 17:26:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551979563; bh=HYnCufl3CU9zNzQyfcJYCBG7ma2GdInSvab6ChWFbvo=; h=Subject:To:Cc:From:Date:List-ID:From; b=SnFcE6l3hwUOKcxoTfAjK2C+NKI/RdBqxohLrSA0PGlY/bGJiyDas7eB16NiVonkG Qje89Ssc5qAAXBVbd2nc+7o2vMmVZlhGtLxFItp0kdvYZ5HopFGqmi6p2au9RlAI9F stxEgmMcrAQMyNPLUJ/NvbAWsCLxYs4/gRQ8OyTw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726233AbfCGR0C (ORCPT ); Thu, 7 Mar 2019 12:26:02 -0500 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:55027 "EHLO wout2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726224AbfCGR0C (ORCPT ); Thu, 7 Mar 2019 12:26:02 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 8249D3762; Thu, 7 Mar 2019 12:26:01 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 07 Mar 2019 12:26:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=TIzbsA znxeCFwCYsAqDvaoRTjnML5XOQR7SZlijnkSg=; b=wnssKqlvb/kbzIkWWD5Mzb VlTzreJv3DiEImlF2LAnW/D2GK6fFEdKDvaxlO6BdbkeBsILoVtHFIQzMTfkRhjE tRVsSvCEbCrERK9SDIAzY83sKcoWbx/a2vVfLLrtwFMDEKGTG08Mqfs63magA7XM tEFbX+IKrdDnkW/7Y4opKIPoBbv9890sC6e09CljYheqXrSVGcXuFRWpzQYG8kXg At3Sqbk/PUrKA+gCXmWGBHLbaJkQ+yM9d5l25YQQQAk2q6Fjm7D70CMADCnBX+gT RS5RdKLCOEXuoQ2PuAEdZJb3TRGFC+10ViocfBXm0+PqByAVCaMD+NvJQ2nzZLSA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrfeekgddutdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvffhfffkgggtgfesthekredttd dtlfenucfhrhhomhepoehgrhgvghhkhheslhhinhhugihfohhunhgurghtihhonhdrohhr gheqnecukfhppeekfedrkeeirdekledruddtjeenucfrrghrrghmpehmrghilhhfrhhomh epghhrvghgsehkrhhorghhrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost (5356596b.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id CE0A2E456D; Thu, 7 Mar 2019 12:25:59 -0500 (EST) Subject: FAILED: patch "[PATCH] staging: erofs: fix memleak of inode's shared xattr array" failed to apply to 4.19-stable tree To: shengyong1@huawei.com, gaoxiang25@huawei.com, gregkh@linuxfoundation.org, stable@vger.kernel.org Cc: From: Date: Thu, 07 Mar 2019 18:25:58 +0100 Message-ID: <15519795582137@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 The patch below does not apply to the 4.19-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 3b1b5291f79d040d549d7c746669fc30e8045b9b Mon Sep 17 00:00:00 2001 From: Sheng Yong Date: Thu, 14 Feb 2019 14:46:36 +0800 Subject: [PATCH] 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 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;