Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp580474img; Fri, 22 Mar 2019 04:28:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJlbRfTDicOrIpspydDu1VBmiscYro4BLDK8PuSQv0e9vhzyvF5Zwv6ARWRxagLPnkVofY X-Received: by 2002:a17:902:203:: with SMTP id 3mr9088964plc.336.1553254121027; Fri, 22 Mar 2019 04:28:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553254121; cv=none; d=google.com; s=arc-20160816; b=G3WKswpGj6h1DyUkJAuSZe5BwRo2b+qRvPWlung3nwFbXYp059+PWjpTi3ByoNwyGL u/dcxOVgopnmZSOOrKZ7gRKqngfSwbGFcrn+U7V3HHxsftb6ogk2xB4ogRScB2Z9hYZ0 DJv146DWnIa/K4mhrGuX5ZNKfEPQw6JtMKfIMiqUDxvLucl1FEHrmcIJiPCu15vIWvC0 wQc1zahzIX750WYtVhK4/6HxJVgGnUdnu/G1Fle4SOiq66poIkddCGcwCTAoqmYSPbNg eAo7BPzB/95ABFTooXZrdsvFjJIqmORL/BGPDpo3tHKnBjj/TQqAhWN84KYOS31fK5pv 1MmQ== 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=p+kEzuqEcKWTA4I03aG0tk1NSd2tkTQ99aFUTAZQKDg=; b=DcfIuE8MzVKOvG6C3oPerOGKDeEphZiZq7sRk7hD1oSg+nDHSfnIOsigSmDL8LVCIP gh0RHeTu9yzeDybY/Pz6oEWS1UGCUci5Wbg9CZ6PKb7BtgleREaqUw7bK0GWxBqN/KCi PT2XBsti92G2ZYWvY0ZqvaGaWgE2+aBGC4VZliurHbW2misYje4eEHjhWMYDMLIjwNs4 HssZrlxhxrlDQmxzRE56GoOH+t+mNliaGy5lIgEed9HELPOE6m+qvnFg07HHL74Cbj9W Bv/N44qa/ls280zI1uMDnWDgV8VUEA3HkIpqOLDsrgQR1W/wWeq6frDBQOWq+RkPLhH8 gk6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vqy3m02+; 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 m15si6289367pgv.212.2019.03.22.04.28.23; Fri, 22 Mar 2019 04:28:41 -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=vqy3m02+; 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 S1729471AbfCVL0t (ORCPT + 99 others); Fri, 22 Mar 2019 07:26:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:54532 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729454AbfCVL0s (ORCPT ); Fri, 22 Mar 2019 07:26:48 -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 7C6B320657; Fri, 22 Mar 2019 11:26:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553254008; bh=IHjFbVGS/uo9iMqCymCWQY/UG08xlc+YdXwK2kHPVPM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vqy3m02+ijR3oRN5R8VnBW+2L9W2p9G2EtHPwiktN148sPX3TYn06llptPbl6tppF dY769T4UzbLNOY7vGRV3cTpKr8BEyF291Cx/PSf12Zi371nTmeBVO4ngtrFUxxixWn U00djEJ9DuKeC1w4dyIGGttcI9VwMfvmTc9ubsMY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Joseph Qi , Yihao Wu , "J. Bruce Fields" Subject: [PATCH 3.18 130/134] nfsd: fix wrong check in write_v4_end_grace() Date: Fri, 22 Mar 2019 12:15:43 +0100 Message-Id: <20190322111219.939225536@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190322111210.465931067@linuxfoundation.org> References: <20190322111210.465931067@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yihao Wu commit dd838821f0a29781b185cd8fb8e48d5c177bd838 upstream. Commit 62a063b8e7d1 "nfsd4: fix crash on writing v4_end_grace before nfsd startup" is trying to fix a NULL dereference issue, but it mistakenly checks if the nfsd server is started. So fix it. Fixes: 62a063b8e7d1 "nfsd4: fix crash on writing v4_end_grace before nfsd startup" Cc: stable@vger.kernel.org Reviewed-by: Joseph Qi Signed-off-by: Yihao Wu Signed-off-by: J. Bruce Fields Signed-off-by: Greg Kroah-Hartman --- fs/nfsd/nfsctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c @@ -1110,7 +1110,7 @@ static ssize_t write_v4_end_grace(struct case 'Y': case 'y': case '1': - if (nn->nfsd_serv) + if (!nn->nfsd_serv) return -EBUSY; nfsd4_end_grace(nn); break;