From nobody Mon Mar 28 22:13:46 2022 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 034A61A324E6; Mon, 28 Mar 2022 22:13:47 +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 4KS6RG6fGxz4V4H; Mon, 28 Mar 2022 22:13:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648505626; 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=ZIdhtJrL91nXiK7/R+PPO40+HtQhkVRM/2eS/VRj2Ms=; b=Gn+pjPSgMvtrlpF5l72R1WV/9jEOUK5lJYwXBH9/4fMy8mUCxfUKWci8cOjs1EU3kHYV+2 w72sg5J0E8YihzlRdWzHDQ5chj4b7s9W1CJTFJQYwMUTPro+SS0rsj/Vk/Lq/KCH52rIZE ZZ8I9RjWm+VyhTP/aoOZMskg4hnKYfgUmESmJxS5xu2tqY2qpgCOa6LOdDw+4jcnv5kBAi XCBEEc8s7/6lX7JSYyov913jJd68hIQGvyLAobxrhty8bYmhGCNjonQ18pUpCj6JLrFMM3 uMlY+MkCMZeKR03J8CZqZgjGMHEzEpWNLmf0M0xdRajI8J6/CDdzqaf8PmryRg== 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 C3C7C1255B; Mon, 28 Mar 2022 22:13:46 +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 22SMDkgo041290; Mon, 28 Mar 2022 22:13:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22SMDkUd041289; Mon, 28 Mar 2022 22:13:46 GMT (envelope-from git) Date: Mon, 28 Mar 2022 22:13:46 GMT Message-Id: <202203282213.22SMDkUd041289@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: c1970a7ebab5 - main - nfscl: Fix IO_APPEND writes from kernel space 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/main X-Git-Reftype: branch X-Git-Commit: c1970a7ebab582d19694c9a525ed6eb4512fdb73 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1648505626; 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=ZIdhtJrL91nXiK7/R+PPO40+HtQhkVRM/2eS/VRj2Ms=; b=Q+oVp/JmjSmVJV55gecXcIVK1hXAorRFGsspqeXsWwPIR8GlYVLcWVLsxN2Ahee7g2PYHp 4h/pCUK6Zp8erSpoD/1pQp7E9quzOBVxHmn5kZ8SunrEQUS1CKBvQVKIUVDrvfQBQEOWyr DUMwscEjO7/U0iMv8/KE+zNaneFk84xCCIRds4xFSvocI6sOKBqbEN+2JmSiDSG3spPOHv Qt8sygRT9FCTjFBBN9o+nMSZxzcjWp7b0R5qtGAMZztG7WZD/rG0RfauzuJQuiP0GT6FPs JxoexcGej7oTurrXET1/BkzK8qQ5CTPpt8kCQS+ygLFCOndIkFFuaG8BE55HHQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1648505626; a=rsa-sha256; cv=none; b=LQW14MlvZ2rrxSpmXjaRCKEDgFYoaaAVD1Kf45w9dZFkJIpgi34b7JAd4ibEKqemFcAztA +rbRlbc7tNFoMjkGBDHh57bjFuAP/nVu6IlL1lobu8CCDh9XDwoltr7kcopEuTaUtqhRKq 6O4+6DNzgy9nCQw4+DbvnZAZ+GQ//Hq/j91eOs+LMkUonDD5NoZnDfN4hIvdmcZvykAhQP A/IgRr3Jk8/co3z0KmMFN+F2jSxIGDITm9KuQZ9yxqyZcZ9RhdOLjvj7Sdd4oiT+uYk+4O pEfpH3TWeRAbrDLDWXjQnxKlrOZFc2vky7dmnaDL2dXj4V6BBm+7OPaaUNh7yA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=c1970a7ebab582d19694c9a525ed6eb4512fdb73 commit c1970a7ebab582d19694c9a525ed6eb4512fdb73 Author: Rick Macklem AuthorDate: 2022-03-28 22:11:52 +0000 Commit: Rick Macklem CommitDate: 2022-03-28 22:11:52 +0000 nfscl: Fix IO_APPEND writes from kernel space Commit 867c27c23a5c modified the NFS client so that it did IO_APPEND writes directly to the NFS server bypassing the buffer cache, via a call to nfs_directio_write(). Unfortunately, this (very old) function assumed that the uio iov was for user space addresses. As such, a IO_APPEND VOP_WRITE() that was for system space, such as ktrace(1) does, would write bogus data. This patch fixes nfs_directio_write() so that it handles kernel space uio iovs. Reported by: bz Tested by: bz MFC after: 2 weeks --- sys/fs/nfsclient/nfs_clbio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index 00a3e5d12dd7..3103d87fc8af 100644 --- a/sys/fs/nfsclient/nfs_clbio.c +++ b/sys/fs/nfsclient/nfs_clbio.c @@ -780,7 +780,7 @@ do_sync: uio.uio_iovcnt = 1; uio.uio_offset = uiop->uio_offset; uio.uio_resid = size; - uio.uio_segflg = UIO_USERSPACE; + uio.uio_segflg = uiop->uio_segflg; uio.uio_rw = UIO_WRITE; uio.uio_td = td; iomode = NFSWRITE_FILESYNC;