Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp821862pxb; Tue, 3 Nov 2020 13:31:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJwk7eVHQJofHuboMj0aku2EKfbuX7Q841kn3AyT2aRSgqjkAD1vdHcYZWIU6jLv+sROckrj X-Received: by 2002:a17:906:3a8c:: with SMTP id y12mr21051144ejd.531.1604439074032; Tue, 03 Nov 2020 13:31:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604439074; cv=none; d=google.com; s=arc-20160816; b=eU9wIR72Y3JNbaCOItfOJ8ibRvINljMJ3ff2A2SRp1uup7XYXptBeUj4ivyI4pvd0D 6voI15F7uCeZWccMIvRha1SvGRK5vZUm7sMYmK4m/vZBNexGNwuKIAlCDOqOuAwARbgy rbO9YXqcEMIsQuF4AWZDs9pQJ6CUrEcGVwH+/M34cowOJCFZvIJWa85xPAPhat1r5Mzd jRrlxWNK0jLn8CqFsVCGQgBvaI3MWy3D81QvU0Dfa6m84QYMdQMGaRWZXZkRFjf25Ilc 7Rcv1w/lQWCUYSYQoaU7AZJbQGYZH+33E6a//zNrb7IgqPk7GnsD+p7Z0Ab6mQaX7lnb v0Fw== 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=Bsx6fyAiob2bGBoN8qbJfS/XJQHNaGZHjLJ42YOSP9Y=; b=fjhwXLr2+i8fc/vEUE6KP09285HWLxfhXSdXNQhTTz0Ey5b/kwjPp6oXuBSJ9Y4nBD nCRv18WShEkqfPStoWNe6ShQ++750rCmp4AgvJYre509N0+o4VuCk+iMZmbVfoEFj3J3 IvytCvzZs4sfgW+EsBs0b+ZZZPy1l6r1v2Uhcb+VYVtGhgyuT7CRreAyXI+F3TyeQaqy zs+hM6ty5cv4yTKRi3vR2LbQ3FtT7XtNaJgRYv+SHWOlRJ1i/oB8fGdf1mzLTm1hzPJx 5q1OYnJe3ZrYk0ice5yJcvOui4spxP1OqQgBfG+SU9yx9iUbaTcL9ciHQfsGD3YtTJ4g He5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=w1lC3ohN; 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 b26si69642ejd.476.2020.11.03.13.30.51; Tue, 03 Nov 2020 13:31:14 -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=w1lC3ohN; 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 S1731290AbgKCV2T (ORCPT + 99 others); Tue, 3 Nov 2020 16:28:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:35784 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731861AbgKCVAM (ORCPT ); Tue, 3 Nov 2020 16:00:12 -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 34A9D223AC; Tue, 3 Nov 2020 21:00:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437211; bh=/b/acaEf9zhn+F7qRQmx6w/c+oLqblBRDguVyq9v2Zo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w1lC3ohNnKyRp27+BCV0CFubhYPTYOUX8bMxUpBp3gHI/8CzIFSvutTs+aot8kplC mR+NoQsnKM/iZZzUK+aL9r7uuQLDnQhyWGDphwFN+0sly2A3PoeLb+nu2U9uwqyG+s Coh3d5h3Els9OmPmNfhFfB7QjdBDjQaw6jZT4ync= 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 5.4 192/214] ext4: fix leaking sysfs kobject after failed mount Date: Tue, 3 Nov 2020 21:37:20 +0100 Message-Id: <20201103203308.663686799@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203249.448706377@linuxfoundation.org> References: <20201103203249.448706377@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 @@ -4684,6 +4684,7 @@ cantfind_ext4: failed_mount8: ext4_unregister_sysfs(sb); + kobject_put(&sbi->s_kobj); failed_mount7: ext4_unregister_li_request(sb); failed_mount6: