From nobody Fri Dec 22 20:33:39 2023 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 4SxfCQ0kDRz54R2k; Fri, 22 Dec 2023 20:33:54 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SxfCP62Z4z4PPF; Fri, 22 Dec 2023 20:33:53 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-28b82dc11e6so1373940a91.1; Fri, 22 Dec 2023 12:33:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703277231; x=1703882031; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=UFzqv4YthDtWP5+KEdmyr46GCHSUaglW3osh55hMvnk=; b=eJjS5eMhFrkI41S4koEmff4jscy/ZEyotw1JcrnDjZeBVG/u6B3SKmoTuTT5LQ0/0J 4L63re9YxYWbNoxA0ROs00XlVPXCYJMFDSG70NvLha6gL3yvlwfczd8d4Xy/v6A+Jpid pBtXKgsnPK1C9TOtcec3wxPvEJtyCXRGr8ENmGGgn8c47mWWbxJaDreEYyO5ySsk9ReW AK7VGnsOgSTvNEM4aLEFuI4b7+sWea133UB/iu6FjohkBMzzbV0DTOcnrfXtn0G3sJlq KcpQbiay5tJ+2BldR0NZv0827/CvQpS2Z5+APUu8e7X48RQ96jpxKe6UgAhAdb8bhxD4 b53w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703277231; x=1703882031; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UFzqv4YthDtWP5+KEdmyr46GCHSUaglW3osh55hMvnk=; b=T5fsV2xW4Y4u9dApdMZV8ClN82ZFp/WTjfCrZu2B5Xie4HT0Mh/07eNiBZWLM1SjpU qi27lOcG7yBfaNKOZXA5l7UBJtGVauzP7idrKJ9N9ZAuqJGVyJ1hXqm5NO+Y40kFzHdi eowZs5swGYJ2KgfGR7VD57oVICK4PrdkS9Pepg5tvE2efIDD9FdOy1Oiab1aOPByw/Ax fpNcgHNHsO7wN5k1C38eof/kEwV7DpPRgh1OVpKKA7FbeCNWaiJuEpXrw019oypnXlpN Pp9DxBekMjuHkflOsIEj4KYR50v7AeEbLGzIPWAvn5xiUMguP2x47f/reZNIHV2gZRpk 5KRw== X-Gm-Message-State: AOJu0YwiGoCDW+6cNi25hNJv7yWUXy1JdR1LUrs94EvdidGr570rrE8W H0UvZJIsfOR3GKTLfKduC5uo4COkOaZCSx6AtoYqgwc= X-Google-Smtp-Source: AGHT+IF/V2Gu8DqzbPzL9rM0D4CbocVkFIMii7gtohRfQxkJaD02MV1+NtlzZywVLZN5/grYeu2l5q8bpNbaa0V6bfs= X-Received: by 2002:a17:90a:898b:b0:28b:6d33:a3c6 with SMTP id v11-20020a17090a898b00b0028b6d33a3c6mr1137022pjn.25.1703277231144; Fri, 22 Dec 2023 12:33:51 -0800 (PST) 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 References: <202312222012.3BMKCfT2047358@gitrepo.freebsd.org> In-Reply-To: <202312222012.3BMKCfT2047358@gitrepo.freebsd.org> From: Rick Macklem Date: Fri, 22 Dec 2023 12:33:39 -0800 Message-ID: Subject: Re: git: b484bcd504a2 - main - nfscl: Fix handling of a copyout() error reply To: Rick Macklem Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[] X-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4SxfCP62Z4z4PPF Just FYI, I missed the MCF after on this commit. I plan to MFC it in a week. rick On Fri, Dec 22, 2023 at 12:13=E2=80=AFPM Rick Macklem wrote: > > CAUTION: This email originated from outside of the University of Guelph. = Do not click links or open attachments unless you recognize the sender and = know the content is safe. If in doubt, forward suspicious emails to IThelp@= uoguelph.ca. > > > The branch main has been updated by rmacklem: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3Db484bcd504a29037752d5214a4= 18412724761d88 > > commit b484bcd504a29037752d5214a418412724761d88 > Author: Rick Macklem > AuthorDate: 2023-12-22 20:11:22 +0000 > Commit: Rick Macklem > CommitDate: 2023-12-22 20:11:22 +0000 > > nfscl: Fix handling of a copyout() error reply > > If vfs.nfs.nfs_directio_enable is set non-zero (the default is > zero) and a file on an NFS mount is read after being opened > with O_DIRECT | O_ RDONLY, a call to nfsm_mbufuio() calls > copyout() without checking for an error return. > If copyout() returns EFAULT, this would not work correctly. > > Only the call path > VOP_READ()->ncl_readrpc()->nfsrpc_read()->nfsrpc_readrpc() > will do this and the error return for EFAULT will > be returned back to VOP_READ(). > > This patch adds the error check to nfsm_mbufuio(). > > Reviewed by: markj > Differential Revision: https://reviews.freebsd.org/D43160 > --- > sys/fs/nfs/nfs_commonsubs.c | 14 +++++--------- > 1 file changed, 5 insertions(+), 9 deletions(-) > > diff --git a/sys/fs/nfs/nfs_commonsubs.c b/sys/fs/nfs/nfs_commonsubs.c > index 832713e6c1de..e79f73739487 100644 > --- a/sys/fs/nfs/nfs_commonsubs.c > +++ b/sys/fs/nfs/nfs_commonsubs.c > @@ -679,17 +679,13 @@ nfsm_mbufuio(struct nfsrv_descript *nd, struct uio = *uiop, int siz) > ("len %d, corrupted mbuf?", len)); > } > xfer =3D (left > len) ? len : left; > -#ifdef notdef > - /* Not Yet.. */ > - if (uiop->uio_iov->iov_op !=3D NULL) > - (*(uiop->uio_iov->iov_op)) > - (mbufcp, uiocp, xfer); > - else > -#endif > if (uiop->uio_segflg =3D=3D UIO_SYSSPACE) > NFSBCOPY(mbufcp, uiocp, xfer); > - else > - copyout(mbufcp, uiocp, xfer); > + else { > + error =3D copyout(mbufcp, uiocp, xfer); > + if (error !=3D 0) > + goto out; > + } > left -=3D xfer; > len -=3D xfer; > mbufcp +=3D xfer;