Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp319636yba; Wed, 3 Apr 2019 09:18:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsJfOaHtu7aTkc/gH6BVlusSnHoRM1xICRtcVxaB0zd890tEeV66pHtbXSauvTR9F95FGw X-Received: by 2002:a63:6e0e:: with SMTP id j14mr488144pgc.203.1554308292142; Wed, 03 Apr 2019 09:18:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554308292; cv=none; d=google.com; s=arc-20160816; b=g/KTEiIhcolrxiHvMCBGmfUMlHOy6wsXDF92zFT44M3bAdt/gxcovAtckbdrfW9JkL LhRFkPn5rNDkn/jF1h2aQSYotFxrnLIe9j4v0WkkqxDm1291d520rWlphmkNo7My2KtD 2B5hKnpNoDaS5jWXiwgRz54qxot1FXvR6BUGNnBWSYyiT86WkU4u1QxfalclL3Z+RXmM ELblw/JZ9mbgSdKwBP4ghobelyzw42fjwqtJONqgLBOytjhgNJW+GvYzZBrebqZ6bAeh bTcbVsXwsP1eOjgeHD4oXKA26j3arfP11I3LRoNL9p2sxUhEmzA86UwCTdzjTQIkWldO VrUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wlhMKpcpaFCO52YuhqtFjUcjFF9z+9VkeYZ1xecljng=; b=K6ges940kQn9k1gZv2+QEPp00/uQQItrEfxh51viJndq3Shmb2hK6yZdF6M4OQ9Z30 /TZyIj8XPwRgg9bovDovg90A8kVo8EdIhri0ZAA18+C4nOT/BcXVz7zDgpdtkanK5k3B 3n1UbPOzed4/vSPIMmQ/E2UxbdEkRf+kuvN1WKfO790dmaW8JxZYJwm96LOIqQCGV7ai WjYxASaZ92Tc2nh3jc+VztErdXgjaWjKjnAcmQrTMJM4EWtrRQALS+3pSm2YP8hNcF/x HwZ8VkwvySa4uy8mPnI1diyr/LXVF2CCDbxkuZFy7FpNGu/209qpW/TKMcb9SGjjc91q IuRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=U+6m66Ab; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g5si14096348pfi.60.2019.04.03.09.17.56; Wed, 03 Apr 2019 09:18:12 -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; dkim=pass header.i=@kernel.org header.s=default header.b=U+6m66Ab; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726588AbfDCQRT (ORCPT + 99 others); Wed, 3 Apr 2019 12:17:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:46274 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725990AbfDCQRT (ORCPT ); Wed, 3 Apr 2019 12:17:19 -0400 Received: from localhost (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (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 5E264206B7; Wed, 3 Apr 2019 16:17:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554308238; bh=4ad0WdrRQyGOKRnAcVv+KyQJGoUhZqOCasLbvMBNySk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=U+6m66Abh1YW2NLO9TCl+cPkHitFByGYD1kOWqY9cl5X46kalcGvHF2mo44X4FeOO m667JdtdeSlsTwat++bXKNVGWXxnt89PE8F9MCm3FY7awUR3qbfIuRTOsWipefd1dm KzFL6Y4CwJRDZZCBftk2JB+WYL/SHG6LtQlbm88I= Date: Wed, 3 Apr 2019 12:17:17 -0400 From: Sasha Levin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux-block@vger.kernel.org Subject: Re: [PATCH AUTOSEL 4.19 33/57] blk-mq: protect debugfs_create_files() from failures Message-ID: <20190403161717.GC16241@sasha-vm> References: <20190330012854.32212-1-sashal@kernel.org> <20190330012854.32212-33-sashal@kernel.org> <20190330054311.GA23655@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20190330054311.GA23655@kroah.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 30, 2019 at 06:43:11AM +0100, Greg Kroah-Hartman wrote: >On Fri, Mar 29, 2019 at 09:28:26PM -0400, Sasha Levin wrote: >> From: Greg Kroah-Hartman >> >> [ Upstream commit 36991ca68db9dd43bac7f3519f080ee3939263ef ] >> >> If debugfs were to return a non-NULL error for a debugfs call, using >> that pointer later in debugfs_create_files() would crash. >> >> Fix that by properly checking the pointer before referencing it. >> >> Reported-by: Michal Hocko >> Reported-and-tested-by: syzbot+b382ba6a802a3d242790@syzkaller.appspotmail.com >> Reported-by: Tetsuo Handa >> Signed-off-by: Greg Kroah-Hartman >> Signed-off-by: Sasha Levin >> --- >> block/blk-mq-debugfs.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c >> index cb1e6cf7ac48..9dc3a0896462 100644 >> --- a/block/blk-mq-debugfs.c >> +++ b/block/blk-mq-debugfs.c >> @@ -806,6 +806,9 @@ static const struct blk_mq_debugfs_attr blk_mq_debugfs_ctx_attrs[] = { >> static bool debugfs_create_files(struct dentry *parent, void *data, >> const struct blk_mq_debugfs_attr *attr) >> { >> + if (IS_ERR_OR_NULL(parent)) >> + return false; >> + >> d_inode(parent)->i_private = data; >> >> for (; attr->name; attr++) { >> -- >> 2.19.1 >> > >This was a 5.0-only thing, no need for it to be backported anywhere. >Please drop it from all of your trees. Dropped, thanks. -- Thanks, Sasha