Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp568437ybn; Thu, 3 Oct 2019 09:00:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqwTZ2UcR522FehdQ954LAmUaHKQ/8FuXKm2ZF6bTvMn4NtOp9uYpjO0JCURc8IFsCYUhHF4 X-Received: by 2002:a05:6402:356:: with SMTP id r22mr10205682edw.254.1570118421982; Thu, 03 Oct 2019 09:00:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570118421; cv=none; d=google.com; s=arc-20160816; b=T0+3D1G/mOj6TQ1Zjv9JeYYIXvw4PZPRWOmnRr41V0DKZpVrgqzVxCySNXrDiFRJbm Gmgi7sUjKvydk810Ds+saLMmxW8iYrDRJiTGCg1kqrbh9ZN3q068dTF8fbCkFqGmZgU+ f3gAIUcFGwDyND+YaKiHDm8PrxseuHhwQ2rqcpVHclICH9JUaCwk4X4sCMjQBiVnBKUw w3i84X65m9LDpXtam/GKLjpadrRHf8X550+t+COuUexShS+uEWm02+dYWVkCtMUL0pjy 0fgSCLZzNGB2WPyMqE1mW4kDuI06Fzh/Xy5vNfd9Ba0BIzi84KsVmX7Ccift2fl3qOiL /XWA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=fwzdp89fg10DVYLZl5wNtXygLQKzNTsL0Rn7eJK0jNI=; b=fiybEemBZzWPARCvpCvBiTwxrcwJqokqk9sH1ihTYwPLjyPdhQm2m8cx++4ukgwtI4 oNINJURb7OBSdYYL2CzYirJBxMlFoUFNOFTiig53bk7cpNr4VU+LumyJ+chZMDH7vSiK oCY9Ryel+ZZuc+wPPOop1m5/QuiUQuVGnJjY+IpN49ApPAxGqU2RSlZ/rrP4y54hxrRu 1xlw8kadtUdNceH+zPkfzfIhX8u1caytxc2VH0FtfQcgwa4dxGcCw59JTHR3yNY/yDxF 2yoTE6zwVVvRJ5Z/KOJIhBmA7kfR5XS7QsGWN5vSRoBMkzDrXdUaTU1ansTvFPRrMVkl sxiw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n13si1456537ejr.34.2019.10.03.08.59.22; Thu, 03 Oct 2019 09:00:21 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730143AbfJCPgA (ORCPT + 99 others); Thu, 3 Oct 2019 11:36:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54374 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730005AbfJCPf7 (ORCPT ); Thu, 3 Oct 2019 11:35:59 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C1FB519D369; Thu, 3 Oct 2019 15:35:59 +0000 (UTC) Received: from cicero.redhat.com (unknown [10.33.36.36]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D74C960C18; Thu, 3 Oct 2019 15:35:55 +0000 (UTC) From: Andrew Price To: cluster-devel@redhat.com Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, syzbot+c2fdfd2b783754878fb6@syzkaller.appspotmail.com Subject: [PATCH] gfs2: Fix memory leak when gfs2meta's fs_context is freed Date: Thu, 3 Oct 2019 16:35:52 +0100 Message-Id: <20191003153552.2015-1-anprice@redhat.com> In-Reply-To: <000000000000afc1b40593f68888@google.com> References: <000000000000afc1b40593f68888@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 03 Oct 2019 15:35:59 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gfs2 and gfs2meta share an ->init_fs_context function which allocates an args structure stored in fc->fs_private. gfs2 registers a ->free function to free this memory when the fs_context is cleaned up, but there was not one registered for gfs2meta, causing a leak. Register a ->free function for gfs2meta. The existing gfs2_fc_free function does what we need. Reported-by: syzbot+c2fdfd2b783754878fb6@syzkaller.appspotmail.com Signed-off-by: Andrew Price --- fs/gfs2/ops_fstype.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index 681b44682b0d..dc61af2c4d5e 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -1600,6 +1600,7 @@ static int gfs2_meta_get_tree(struct fs_context *fc) } static const struct fs_context_operations gfs2_meta_context_ops = { + .free = gfs2_fc_free, .get_tree = gfs2_meta_get_tree, }; -- 2.21.0