Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10426114ybi; Wed, 24 Jul 2019 23:01:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqwhIgt5qIlL4WXDfl31QHUmjW+lK1ruLXnKOkXnRDB25M7NdXH+i6fvH4fuJfkN8ViMG6kZ X-Received: by 2002:a63:c748:: with SMTP id v8mr53464632pgg.418.1564034468739; Wed, 24 Jul 2019 23:01:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564034468; cv=none; d=google.com; s=arc-20160816; b=h08fsbvrF0q+qhP1IP6UBjSLBKL3ffhxtxCuCuW3m+lP8eUXZh8FEynlZnZ3j3aknX GDPY1K2diU0O+NR7earqSz2mZ31gVywlalxUW9bXBcxfkgpJIVWNI2aJFamgrwCmzNmj ZxMQ/BvH0J7EiFUGvPLaHAdCRKFJCbl90pqkI/D0pyfYiVHoTSaBjzFV8zyJLvVfcPvU h4LeJQsGQpmvqbuj6+QDOW1jBd5FYhkrMQoW9RdmvGk4lSDI8znLbNb5MiRwZSNM4A/Y zQZbVbRSHjzJ3Fe5uqmYYd/b6rkEMqJ9ThXnGNMnyWdF03l9hB01rvQiGhqm50RqI2sC gnzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7MrUgg4FdzBEgWGejNbxjnz9ni1xf21rOjNNgZPrO/I=; b=kPpWbtodc7/286JCjiFUfsJtbDBRKTuVxElrUZ1q9L7tf3jWYfIPOpVKyh6+dGsedk QKa2NorWK7ksq94ZZJUykKrNLK6cDyRRJmMMgHAZ6fwyeyELkPke2hNdRuPL3K6jW8EU 6xoHmUkLKGeVaz/LxolVnp6qag317xAYxAoC7nA6D46wT8PRitztfTqZjXf4CqacjNMl /boJ+c860HEkRUXW2eR34B/jkYK6A3d+u7kEfMYJCuLLSJPEv1djGvFu6JhIVQFmt7mF rimewShuuFTtIFmZk2Mp0uK5B/uSqDV7XK3fccAMDI1ISXGZe/1mSF0c7OHr8XkwyQFd SB5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VBUClhNw; 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 3si15992738pli.12.2019.07.24.23.00.54; Wed, 24 Jul 2019 23:01:08 -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=VBUClhNw; 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 S2391084AbfGYFno (ORCPT + 99 others); Thu, 25 Jul 2019 01:43:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:58628 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391068AbfGYFnj (ORCPT ); Thu, 25 Jul 2019 01:43:39 -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 0E32121850; Thu, 25 Jul 2019 05:43:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564033418; bh=SmSxi14AoMHKWYqCMhqZheNF2R5QiOX/e7UiVlLGLzw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VBUClhNwVP1SmcEcGbML2ZLL9wF9uQHlk/f+LGl7KPFUdT19+F51ksFYyl+2kc9FJ z1J6ah3Wre3XmADOb441tEY4dQmHCMkLGsBQd5ReqFxagSrqPk+/YlZkbQNBNhOnJR jlLtnuMNFwrbjUSDnuzxOaZGEwJnfMfYG6bNZMjI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Trond Myklebust Subject: [PATCH 4.19 200/271] pnfs/flexfiles: Fix PTR_ERR() dereferences in ff_layout_track_ds_error Date: Wed, 24 Jul 2019 21:21:09 +0200 Message-Id: <20190724191712.240675847@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191655.268628197@linuxfoundation.org> References: <20190724191655.268628197@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Trond Myklebust commit 8e04fdfadda75a849c649f7e50fe7d97772e1fcb upstream. mirror->mirror_ds can be NULL if uninitialised, but can contain a PTR_ERR() if call to GETDEVICEINFO failed. Fixes: 65990d1afbd2 ("pNFS/flexfiles: Fix a deadlock on LAYOUTGET") Signed-off-by: Trond Myklebust Cc: stable@vger.kernel.org # 4.10+ Signed-off-by: Greg Kroah-Hartman --- fs/nfs/flexfilelayout/flexfilelayoutdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c +++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c @@ -307,7 +307,7 @@ int ff_layout_track_ds_error(struct nfs4 if (status == 0) return 0; - if (mirror->mirror_ds == NULL) + if (IS_ERR_OR_NULL(mirror->mirror_ds)) return -EINVAL; dserr = kmalloc(sizeof(*dserr), gfp_flags);