Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3882959pxb; Tue, 17 Nov 2020 06:08:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJy4hWcdirwp9khuhsylrtAyU/HIx5mwSQXEtpm88UJmOS/FcTVhyQqa2+R7vDgsNyENmVcV X-Received: by 2002:a50:c40d:: with SMTP id v13mr21267006edf.1.1605622130967; Tue, 17 Nov 2020 06:08:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605622130; cv=none; d=google.com; s=arc-20160816; b=QrnEfqqFQ0qFl4RP/6LX86lXGoYRwDg7RSX5PJ5RUU6AF7xxZpd1YwLykKkVvWHU7w b4mupc5SinhtYkSyCamfeD+4svYP+ncVfhgFEX+0aGhppGzWH0O0icPvvpNg6ivjjUgj B2JTZssF//sQRsveF7HNiZzugYS6YA+CwWPJue2pSB8OwBkVSu/InOZK1WEZw5mZm5Nc uRwIsc5xZyxd3JvNCIhAXVPnrhmK/4XAwyvbCb9cHZ4sf+3v7IELR/ZaG7gORLVLThcp aPvljVvguq68jnNzimne5/fTtdPfAgKTkfAr0ghVRKmoEUuIDC/i5MtPitsGX0aoKG5G dLsA== 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=xREVCl50IKU+ABIMN1BS7hfLkNCCPw33zztyz3A0BIE=; b=f+KGZesrwx6YHahKgooUURjkCa812SjCUmuB+ZicHY9Mr0BYwslX7l03pe7oVrGmiX Ccd1czGKdzD+8oxowmWwW1zifZsTcBda9htSjGBoPPoWpmgbt2Y1beMzl/W3plH3QbVz TYR9z8VejXr9Vyn3oSWBgg4acdbHuZ84XHRrMlUOm/lwhadICOQRB88+A4wvHMi7TGy0 5hslsPpXSTXz9BdZ5uAVHUQk6Uv1YOaAYNaK9UvNDkI1VZezS7QEQL7RevK7uECglC9A JOFNi0oCLyEELFvGYKfK3H1F0Syb95ES+72lWDvKxpKm5p4DrrQ3prcruysgSrdFeQt1 rmeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LXIX6uK3; 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 a16si13015096ejd.678.2020.11.17.06.08.22; Tue, 17 Nov 2020 06:08:50 -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=LXIX6uK3; 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 S1731127AbgKQOFX (ORCPT + 99 others); Tue, 17 Nov 2020 09:05:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:37954 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729397AbgKQNJJ (ORCPT ); Tue, 17 Nov 2020 08:09:09 -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 08336246BB; Tue, 17 Nov 2020 13:09:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605618548; bh=Y2DaeqbYpBoxbz9wwQxrvNwDl9ts4N0917dnWzVbMq4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LXIX6uK3PtyfSMN0Gqj+7CaV0pOWFh/3Bna6Qh1a2U3VyCQwQBEs7zGsz9PARQYDW 3VgcMElvK5L6lLwWK4Q7b9d5nGopig13CcDULUUR7Gtp1TyrQ57A8crnNakQRkrPF9 7ljkhYR6zt1k4kWVweESNDhWrXpxj+o0MRaHcvk4= 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 , Sudip Mukherjee Subject: [PATCH 4.4 63/64] ext4: fix leaking sysfs kobject after failed mount Date: Tue, 17 Nov 2020 14:05:26 +0100 Message-Id: <20201117122109.291080896@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122106.144800239@linuxfoundation.org> References: <20201117122106.144800239@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 [sudip: adjust context] Signed-off-by: Sudip Mukherjee 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 @@ -4168,6 +4168,7 @@ cantfind_ext4: #ifdef CONFIG_QUOTA failed_mount8: ext4_unregister_sysfs(sb); + kobject_put(&sbi->s_kobj); #endif failed_mount7: ext4_unregister_li_request(sb);