Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3935987imm; Mon, 8 Oct 2018 11:58:29 -0700 (PDT) X-Google-Smtp-Source: ACcGV63r41O2AqbjSWOfuWiC1dQP5c2VEDUCROQe0WHSVPSWoaLS+Ic1MeikPzYSKVVs8c+b+/8B X-Received: by 2002:a62:ac15:: with SMTP id v21-v6mr26510121pfe.126.1539025109767; Mon, 08 Oct 2018 11:58:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539025109; cv=none; d=google.com; s=arc-20160816; b=0yJC2+ftPeRnIL9Ive/nyUuJuDGF9U0ibWD+EHorPfefQnWCyqmYAp+hey8K/ma1Wj SAJTcWFRSxZbS2MTzBjuBNFmrxgrB1oOO3R2im+eO9r0I6NQiNOin89gPxRV083K5v2h nLMZtr7dcFWuW1SdwMl2oXZ+6EhbgNMFo4gcmv5djq/cdTqrfkIB9QOhLbM/3E7tmDFl 53Pi0SQHOOZnOO7FbWEKkEAJMXxI6X3aNw6a2euvrUvEXlouM9TAS986JmXUzvZT4M80 Nfx1KXX6TctXWO09N44wtY+K4+VEMDafZzfJohL35tVbhx6b141kTSdpzkR1afeamKlg PBAw== 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=H0gHTc704ZozAxlsB2IbbB5e7jN6bhOLFxNgo9nZirE=; b=PgezdlY4kcthHaPYDwRsyJiiNH4oDDVUsBs/5I/HLa7ZTK7pT2177SR95iPm4NqA9I JS8NPg8AaI6ugNClo3sOzwxjolUfaav1MkKcWpOfyiHHMnE0sJj6NoN12HQWB31bVSWT qmHP6gxcJoebwl0fZ4JwvRuFiv7TOeNlj78A7yv85SF3+FNF0Q687rdSQ+xeMbGciqw1 XQn+mP4JgnQZaUFJXW0KFlYbnfk1DbhNtVHtiB+phrBsjyzggwmK7xhKpTgkrnfTDGPC Ty/j+E31Ug3xs9pt5Ov1ZsuvWCONPJy4yIrTBv9O+dBuLVIChayyS0ShCWlB+nUPonC4 XTnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KXYGyYFQ; 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 w17-v6si18408863plp.335.2018.10.08.11.58.14; Mon, 08 Oct 2018 11:58:29 -0700 (PDT) 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=KXYGyYFQ; 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 S1732608AbeJICF4 (ORCPT + 99 others); Mon, 8 Oct 2018 22:05:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:56172 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732339AbeJICF4 (ORCPT ); Mon, 8 Oct 2018 22:05:56 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (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 61AAF20645; Mon, 8 Oct 2018 18:52:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539024769; bh=8U+91JKWhuK4SIea4dod6WAZIGANUmL9bQGRjauZIXE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KXYGyYFQBPDs1nQXwmH8p1T451LsK7JoOlvz56PhogrMldmbsUwJCjsPiZ9i/vcRo OsT6HJJWua3GM3J87LXE6IFFdSXgHf/BImzqzawhFumzQw4FffpXH+WLLBenzeMXNu P0FmzwMFnxnC5omYQCN7aDa48RvV+wT06sFjQJ2E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Amir Goldstein , Miklos Szeredi Subject: [PATCH 4.18 148/168] ovl: fix memory leak on unlink of indexed file Date: Mon, 8 Oct 2018 20:32:08 +0200 Message-Id: <20181008175625.656311260@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181008175620.043587728@linuxfoundation.org> References: <20181008175620.043587728@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.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Amir Goldstein commit 63e132528032ce937126aba591a7b37ec593a6bb upstream. The memory leak was detected by kmemleak when running xfstests overlay/051,053 Fixes: caf70cb2ba5d ("ovl: cleanup orphan index entries") Cc: # v4.13 Signed-off-by: Amir Goldstein Signed-off-by: Miklos Szeredi Signed-off-by: Greg Kroah-Hartman --- fs/overlayfs/util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/fs/overlayfs/util.c +++ b/fs/overlayfs/util.c @@ -531,7 +531,7 @@ static void ovl_cleanup_index(struct den struct dentry *upperdentry = ovl_dentry_upper(dentry); struct dentry *index = NULL; struct inode *inode; - struct qstr name; + struct qstr name = { }; int err; err = ovl_get_index_name(lowerdentry, &name); @@ -574,6 +574,7 @@ static void ovl_cleanup_index(struct den goto fail; out: + kfree(name.name); dput(index); return;