Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp2207918ybb; Fri, 29 Mar 2019 22:44:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqyK+4hF2Fgus7Y4jkJDDxx2U8tf8CcBkKm142u1mjvQexdFmJIDWwVG+t1Lk041G0OcvTG9 X-Received: by 2002:aa7:8190:: with SMTP id g16mr23955242pfi.92.1553924646532; Fri, 29 Mar 2019 22:44:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553924646; cv=none; d=google.com; s=arc-20160816; b=Mo4HME+EBAK24p7wnZ6kC3dEgU/YjcLryamzpr9huvGNxVigf2h7pFmHQvYgxfbkL2 Z7nOkhgoQnR2ImWyDsbWU38umZm+wQajmS70Y+3siPhb2ZmXTEudmV8hiGTWmXXfz3/y g3YEfiC6y/8htibIV8S1aid6mrNzNZcCfgySYOnM26JG4rilcVTK74mf44ghzuYR2cIY p4iYDL2Xsj6Amg7+J0Us1fcy+43dSkyhUv5mpfTD81ZyxDSzlGSqscGQILAH+oq052qP QlItFGtxc9sti82YHRHuW4FUaFF7HtVrqcgjO/C+PuQo0zmsqmVyqxaL1NBo9x0Zm87n 61QQ== 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=QkFOMoVNHdOwrSDg3osmHhGBMR6XsMsFOsDMHfXYn4Q=; b=gzcfb86Vveh5+HbsLddPlK9Z1gIwdLlkuu6RBqNFcfjFJ/Z4BA6cYg87c0ums+WcQO K79/Jw35vGz9pQvGupD6E5SQJzb6LNfKSxiLTvCf5GT0u5gKP6/kwqkAnzjJh2pKMxjA G8Y6L6Nvo0pdufx9SQTfOu/aGq9oxvfs3A1GFu+HFID8SNs9VhveFNeudQt47tsivW95 Hf7JJa78D2BdhqbmK+OW7ZNQ084jKdKXoCmmqNNVs5Ar0PuzJdhnv+TLNH1PgmIRQ1FV oY0stIZthjqZ+5Kbtpj1NZkEIpNjBPeP55zGNJIllFtMW99J0H3ETOg/RJ0zzsqgoiEs kGYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=K7WYJONP; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h24si3512202pgg.226.2019.03.29.22.43.50; Fri, 29 Mar 2019 22:44:06 -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=K7WYJONP; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730384AbfC3FnP (ORCPT + 99 others); Sat, 30 Mar 2019 01:43:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:38084 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726434AbfC3FnP (ORCPT ); Sat, 30 Mar 2019 01:43:15 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 ECAA2218AC; Sat, 30 Mar 2019 05:43:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553924594; bh=ebyU1xh/LAWXwMIwVYqVq1jdrJRLGm7c+F3dlI/CX8M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=K7WYJONPEV/GhFY9G4mAt2pCMc9p24gDGy9uEJVLWFMiUp34PcVRPSo3bmqsmjncr gM2VcnDhO6ucND9ZhoiQ15p1cf/2p2JLJ5QxGB/4fKmQqK/R+Dq72G19wbq4wzQ/Dm FqylzNDd5aA/fNLEOLz/qVgHd+8+lTLto4/pHSN8= Date: Sat, 30 Mar 2019 06:43:11 +0100 From: Greg Kroah-Hartman To: Sasha Levin 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: <20190330054311.GA23655@kroah.com> References: <20190330012854.32212-1-sashal@kernel.org> <20190330012854.32212-33-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190330012854.32212-33-sashal@kernel.org> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. thanks, greg k-h