Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3881482pxb; Tue, 17 Nov 2020 06:07:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJwtr6pl+ZlRzLaRix3KielBwBbxGec0l3vkQGIuO+Z0L/3BllO7u0QXXgfcplyt99y2RGY+ X-Received: by 2002:a17:906:5a8f:: with SMTP id l15mr19291015ejq.419.1605622034719; Tue, 17 Nov 2020 06:07:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605622034; cv=none; d=google.com; s=arc-20160816; b=F1Xx1qNtl0aQiyelNU7Z6zcWPESCD+PgYaUpjep0eECmgI7YRghRglgZAKx9PQeLLa FnaXG/wTNK9y4JmS5bJOUlUtPkOhMti0Y7VrDkaBU0qI6nOl+chaYKXtRTkO4XfCm5ex RyUV2VIzYCSu8GugQI2rV0Shk+wTzhnqdF4/XO2hkB5eX4E/pKvumAJXDB9v2ctNQqzw OmjZt/bQ07PTmMvAldqyJnZctLBaCtm5YKso97OzIkdT26dwwsw6jgVt/FcBLgn4kVaJ XdlJ6+hT7DzcwOrRFQ5ZYh6fAOyPOJonypN+q9t1BLBOlJZr0Da3fp3DQN9UWTRL6OfC nHqg== 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=yhwmh8+Wa+/KubaP2S97crvCc7x2z6Hb9vKFgJ95Ab4=; b=dmWQcWVsugb7ZA5t+0qbGAqRLIUo9rwG/77OGN5FfgLrz/0CXSW6X8FiHAUNMdkN8B Bi5IUkmq+GPNQ06achZPdNmrlbCGgwb9EMigMMyi5Y+a7MDnLVTH4U+NOheDzUaTYFXJ LbdNb+0VsaUn5cG0w8H8xR2XyZb0pscAAvG8Wq6Z2rPqsp8YH6Dm2kqiv8DstGNzhjSI MrA6Tc2sEkP5SCuUDBUVxqu02ws5idVNUNoFkLUGnflO9j7mT/VVJi73MaIzSrZtgbUm UconjdMQ1tib4ir8l2eDWr0OkDX21NvZtuTUPq+NL5jjk5dGTGz9PdjWSQO9Wq0Ng4pX OthQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lYysMFPo; 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 dc13si14162035edb.350.2020.11.17.06.06.50; Tue, 17 Nov 2020 06:07: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=lYysMFPo; 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 S1729876AbgKQNMq (ORCPT + 99 others); Tue, 17 Nov 2020 08:12:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:42700 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729858AbgKQNMi (ORCPT ); Tue, 17 Nov 2020 08:12: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 3A2DC221EB; Tue, 17 Nov 2020 13:12:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605618757; bh=Rc/JonjrewJk/D4i9150/6CuZjdpzXuSw8qk+z9fRnc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lYysMFPonxdlGREvMXI0TWFyISccMR6U33BZxlmHwnV1qH54O204vH1HwYJZbrXpF rrq1PeK3HVpAo2EDRfzjeb26BcGfAFejwCh6Qgc5+iyzaQ0K09bladzvcrSCuH2M+s Z+AY7FkQPAdq5K7gi+PGJyqTRUyWD752gBrA/sy0= 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.9 77/78] ext4: fix leaking sysfs kobject after failed mount Date: Tue, 17 Nov 2020 14:05:43 +0100 Message-Id: <20201117122112.857600137@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122109.116890262@linuxfoundation.org> References: <20201117122109.116890262@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 @@ -4336,6 +4336,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);