Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3905115ybi; Mon, 29 Jul 2019 15:03:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqwraTLjg5Ry5HnHiM/vAEWyLuTovKC+Oqn+9y2IwqQstrat65XRq+c505/PSDJafEzT+Qyq X-Received: by 2002:a17:90b:f12:: with SMTP id br18mr109298701pjb.127.1564437822555; Mon, 29 Jul 2019 15:03:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564437822; cv=none; d=google.com; s=arc-20160816; b=b9DB0Ghi1l0OwL3CY8A0lokjqYmcNUfa/u9ZlmRy1dzXACz0IsS9m6Jla5W4D3eeNe zJqlUK4rpBCE0bJ4kh9MZZ/98TrWzTFQUi3EapRD7EkSMHInpmWaI81Io4HmT2PmJIiP 1XGxiyIMMeXD9xFIcB2jjtoR7okyktPMJI1x70Mt4Kvx75iejq6VLqy10ES/TilGKHn1 bvBIHnmR04AiNTaDbARPSUhNJNTdMDVVqsZZzETK9m2b19FaN3x5ieOwJRwiWggoWEwz DhqF779teiGXIlK+UvQhy99IYCOF0KRM61cxDmA7oRB0yC+eT2ZCGr8lvkgeWega4BWS oEcg== 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=OgDQO6qu02NoQmZyXP9wPD3x+iJzlxSD5J8Z68YWaCE=; b=B+9eDkgJp4iW6wplng4Xew0smkXEDJx8tTgdfoyuBy0JWC72myiem2YxTksv0hMGZy 0TA23Co0bxey5okLUq622XI9kFQUdCfepcsyYBILdO6zluWfL3DoX+clnWe8iL0nR0MM gHCzQTsrX2r8wK3c9fT67WgkHzihFmOSC5uB+DBX3NjPmks+GAi+OPgeS1VciFSetP5o zABHkN1n8bkljPRw5ZboRy9Z1usWYNNj6Li3+bLIjEbIa+dCRKnxo8aLp+OJtaIv7CBO Lf5bxc6rJDumo5pvugJtgRjNKEuNCnt+3gZ01MHL1stLQ+Z7xi6xJ+ULEIvvliZzqku5 eenA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GQffh8+0; 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 y1si26559540pgg.490.2019.07.29.15.03.27; Mon, 29 Jul 2019 15:03:42 -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=GQffh8+0; 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 S1729169AbfG2Tag (ORCPT + 99 others); Mon, 29 Jul 2019 15:30:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:43282 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729139AbfG2Tac (ORCPT ); Mon, 29 Jul 2019 15:30:32 -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 494412070B; Mon, 29 Jul 2019 19:30:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564428631; bh=ma8d3dNEYqZtZeIzdvGhKY/Cc3YnapHQl95VPRiT/sw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GQffh8+0+9j3UJJ0ySvSEj7QHwfP60dLv0MCUGSJL6eJ+HBlAM/YMHAwONFdNTRFX 8WvGtI47+8hfrsQYjtj1z07MnXdCmcSQ5+MaEPGeVJ4WD+pB82wsu9QjFA4y4oAHIJ mhiOYUTofrKG5lq+HQ/3oFPk2TQ8JGCgGa8UhywU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Trond Myklebust Subject: [PATCH 4.14 136/293] pnfs/flexfiles: Fix PTR_ERR() dereferences in ff_layout_track_ds_error Date: Mon, 29 Jul 2019 21:20:27 +0200 Message-Id: <20190729190834.971956927@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190820.321094988@linuxfoundation.org> References: <20190729190820.321094988@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 @@ -306,7 +306,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);