Received: by 2002:a05:6622:f08:0:0:0:0 with SMTP id l8csp4488539ivc; Tue, 3 Nov 2020 13:22:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJyLYJqFrBs0rU/TI0xIcNm3p9ipFjPdxc+A4cRLIMr1cY6XlaZaZBy7gpAgS9DTOj+dZHdV X-Received: by 2002:aa7:c3c8:: with SMTP id l8mr24013494edr.189.1604438537444; Tue, 03 Nov 2020 13:22:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604438537; cv=none; d=google.com; s=arc-20160816; b=P9yryoj9ylEM+HjDlyOIT5RD9WSnW9f24jzJSB7uhEDMl6eD3vcjf83GYHgUdzpqL6 5WLgACpfRxuJ/iUCHlEX67Ps1pTHgdAdkF2AiK2gX8X6j8W+zReF4TqhO8KgrMQU+znf Yy81j6k67LMx82kvRw181sludhTAdt/kd2olJX4Rz5RUL6nx3Iy4JQdoeDfOdgPFCK2P P7YEYUhwac5omAr1Gsjk1BLleXLGJNmw+4dok60z9TNi5cTSnjpQEfg+h78naYS7gXj0 irhy2Jo538jKV3SXxcxluj/YY38dTGsnr/2qHOgOMtx85q9pF1adN0sB6EXEs/42g+4E xj+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Q1FvK2iHTWJmqujO1apGTUjhZ0V1vsFGpkUrsUKh/rw=; b=QqRXbaOQMbkOVBfJBSx6wIGcS4ltI9uMUDutNcRjj58lyC7LnRLaZfQU6TegxElUFn O1iMR6zO8eUIICs7lJyf2ZAinUpMIqF5YEU59s2c5RnBd5vhWIlqqm4ImGPLcB828f9j e4FarlY/gHjbcJOvRkX+F5OVu6ixqgkZRQZIiDoB/trrgZN1FPdcbg/2t3LZwNTDae9q CuJUexcTZYDqsxJVXKBA6VTliS1k2eZ1uRGmDXY65kb/cldImGE+PMtGGD7tngzx+sAF 5dT4b96E8AkzdNi0VIug7I2YTw1TgWlea8vKtBuoA5rKDbN+gAwfJwHkdAZ9XJq2kgxA LujA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="X4eO/krn"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y7si52510ejd.450.2020.11.03.13.21.54; Tue, 03 Nov 2020 13:22:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="X4eO/krn"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388536AbgKCVIm (ORCPT + 99 others); Tue, 3 Nov 2020 16:08:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:48064 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388531AbgKCVIi (ORCPT ); Tue, 3 Nov 2020 16:08:38 -0500 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 9D199207BC; Tue, 3 Nov 2020 21:08:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437718; bh=lAvzIaZ5f5JLqCus98mw0Vf84esj8jxnWG8QHvEV+ag=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X4eO/krnc+KS94gWgzkXLj4QctKhMIHrpYg2jdWgOzSw0aVxxlMwHzondPwskKd0Q X15YLtohsngenoh28v0SAzdsR59D8aye7FAQL3y65Z6LHapYJM+Wt+nXX2kgauwveY u46ukheX5/o1KJDiFpEPFjDmWLIzfY920tm5SfB4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+9f864abad79fae7c17e1@syzkaller.appspotmail.com, Eric Biggers , Jan Kara , Theodore Tso Subject: [PATCH 4.19 173/191] ext4: fix leaking sysfs kobject after failed mount Date: Tue, 3 Nov 2020 21:37:45 +0100 Message-Id: <20201103203248.773799962@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203232.656475008@linuxfoundation.org> References: <20201103203232.656475008@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eric Biggers commit cb8d53d2c97369029cc638c9274ac7be0a316c75 upstream. ext4_unregister_sysfs() only deletes the kobject. The reference to it needs to be put separately, like ext4_put_super() does. This addresses the syzbot report "memory leak in kobject_set_name_vargs (3)" (https://syzkaller.appspot.com/bug?extid=9f864abad79fae7c17e1). Reported-by: syzbot+9f864abad79fae7c17e1@syzkaller.appspotmail.com Fixes: 72ba74508b28 ("ext4: release sysfs kobject when failing to enable quotas on mount") Cc: stable@vger.kernel.org Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20200922162456.93657-1-ebiggers@kernel.org Reviewed-by: Jan Kara Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/ext4/super.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -4594,6 +4594,7 @@ cantfind_ext4: failed_mount8: ext4_unregister_sysfs(sb); + kobject_put(&sbi->s_kobj); failed_mount7: ext4_unregister_li_request(sb); failed_mount6: