From nobody Thu Dec 23 01:45:33 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 975591910A03; Thu, 23 Dec 2021 01:45:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JKCgx2KTNz3tNn; Thu, 23 Dec 2021 01:45:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30F4627D47; Thu, 23 Dec 2021 01:45:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BN1jXDm050212; Thu, 23 Dec 2021 01:45:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BN1jXMU050211; Thu, 23 Dec 2021 01:45:33 GMT (envelope-from git) Date: Thu, 23 Dec 2021 01:45:33 GMT Message-Id: <202112230145.1BN1jXMU050211@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 055b230b85cd - stable/12 - nfscl: Sanity check the callback tag length List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 055b230b85cde066eeedd1417e336d2acf6281b9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640223933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xbzFkcFJAHr2OIKA6Vo6Xr07Q9TVQHuPz0TDusdZO2g=; b=HpTlz2qRGXLy0fltIFc128zkjh5HMg6LAP3YbXRLk3sYzoee4YTpnE9n3oML61+JK50qth r8E5xb1v1klGPBcTH/+47alb28J29ORIdDi3SGkCKhKvqYrtQZOFtPz1sAQDJqF+e3oOmF gYJrsZGtxdCXuqYsQH0k/XGd9/TVHM3PG+oWH3ZwgSL7LirDTFtnvHOcreOQ+RnuGZNZDw r8ccr+tXcfc5nNbMGQKBfSQlOLmPugiFOk8xa5tUvwxkcKAeinZOI1UUJLOik01DIBsKmK p8l5ef37387UFFMh6hzOCe+3MZkneiJFfCO6HNTWuvF5JClEqtJHdrXT/dE5Gg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640223933; a=rsa-sha256; cv=none; b=BWKpUHHluktjohDBp+/2SAY4TPh9SFoLMNd1qBXY/QndVc8/W2Wuv4kWhNST91gtUCgw/c mPqwJTBtViJogPi6UC+bbc87lWOEtqBETPn7k9AnN4j8zzqR/c27LpQZkiquhsQAmezZxO yHN6HSA8ZECk5xABBmciefe0aICYjpKlh/3jECYVqIM6Ov1doyX+L+JuUFvIORnYyUzCNE KzymT4L87oSsZ3s2uMrUon0fY1z6VfYKHmpMsyg59/cxChTLnV2wFPpgFzQ07iHnQkp8e0 aTaNSti2MEidteUBvZPnq81yP9Nkcxogr7VOmADOftsJgdhaD5jyUvSuUAOTbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=055b230b85cde066eeedd1417e336d2acf6281b9 commit 055b230b85cde066eeedd1417e336d2acf6281b9 Author: Rick Macklem AuthorDate: 2021-12-09 22:15:48 +0000 Commit: Rick Macklem CommitDate: 2021-12-23 01:42:24 +0000 nfscl: Sanity check the callback tag length The sanity check for tag length in a callback request was broken in two ways: It checked for a negative value, but not a large positive value. It did not set taglen to -1, to indicate to the code that it should not be used. This patch fixes both of these issues. PR: 260266 (cherry picked from commit d9931c25617d6625e280fda19bd9c2878e49c091) --- sys/fs/nfsclient/nfs_clstate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index c7b9608da1ba..68e4d3f009bd 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -3422,8 +3422,9 @@ nfscl_docb(struct nfsrv_descript *nd, NFSPROC_T *p) nfsrvd_rephead(nd); NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); taglen = fxdr_unsigned(int, *tl); - if (taglen < 0) { + if (taglen < 0 || taglen > NFSV4_OPAQUELIMIT) { error = EBADRPC; + taglen = -1; goto nfsmout; } if (taglen <= NFSV4_SMALLSTR)