From nobody Tue Dec 26 02:04:23 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 4SzdPN61LZz55KL3; Tue, 26 Dec 2023 02:04:24 +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 4SzdPN168Nz4KSP; Tue, 26 Dec 2023 02:04:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703556264; 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=yuvPCnDtDGgY2icH008h0AphLTN2NoELBjl1I7BWTR4=; b=G/G2P97jUvpodfzKB+d/0rTAasiumCaK7FN/G4046lGXN7q73umzh8x9tq9AZmNxBP2AbS uxGL+Jtg8EQCpLiXUkgj/SQlbH6citQWiQaM7yiUTETkU98ZZ/AWq0oxLTWuI9n6GyUD9U ZaJLKql9TFa2LA4vDVqWDx2eQ3f5kYh//UXgD4Euj/FqiUGwtw6c7qqOyOF9AqoCVv0ga8 HNZOqpO8O2JFhHN3OONOQJjtRmGPFQo00u8tjg6zYCSeYxEmhGGTv4E8+Y3R93nKHauhB0 VfHJ1Xg0jRjW8s1Z6Af8+zWR2RuxUiesv8t3TbDZRvhuytuYVCtEmYUV7jR14g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703556264; a=rsa-sha256; cv=none; b=x3+P+81AlJHhHHjtPk6uNzBpUk+A+AGAHz31byBTPzof5OKN+tefcPC7CSA8W6TCB5b16C Cp1HPmqae9UPy5UVM8BNHFGZORaDr3N1usaM/AfUc9WPzbxxS1UPDbtJfzco0JRUCdo+5p eYAgZo44kOmKhVI0sadOZ9yGA5q1UnMrV6lGhabkM7bt6ZWbQL08WSJ3XbTHGyXResb+LV rBMzvUYZdzPHE+nqYfBFoEG7wcMjrDd3YGhqIP/O0k0JAjCoWB2CtsTcqRCjl5yYptPU7y GlhsO9XyA3JDhuou42vNHE61djSy4g4kmq7d3NwnjWTLq7TSTk1yRsMqBzUcBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703556264; 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=yuvPCnDtDGgY2icH008h0AphLTN2NoELBjl1I7BWTR4=; b=jBeG63Hq3dRysUg1paBittBakGHeLvKGtqMT4q8Q5ZNtjKvSdUcmMBF8kMt5bRSG1lIqK0 rA0WJagQ8g9OI5rDJOTwDiTDdtlPPuPipsLO8QGE2gozaTnrptYTsDw7mImNNaEg3W/F2q dIKsoKpDIeLTRQJ3/lfPxB6OyxSfZhH+J0CRm/fgXczvhDsssexMXGRpAwgRAu3zzr3zR3 mGujPUuGb0yMR6FsVtjVSpERYz3zOBz4Pw/KwDf0TRfArTX5kNLVIH8uxw+pZVPh9UclJz lTK8wuh1KrYppFoW5cnBLffsPMfmnM8y+tm8y9bJcj2mTof4hZ2nAPkU/9sBtA== 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 4SzdPN0CC1zc78; Tue, 26 Dec 2023 02:04:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BQ24N1h003191; Tue, 26 Dec 2023 02:04:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BQ24NE1003188; Tue, 26 Dec 2023 02:04:23 GMT (envelope-from git) Date: Tue, 26 Dec 2023 02:04:23 GMT Message-Id: <202312260204.3BQ24NE1003188@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: d0adc2f283ad - main - sendfile: Explicitly ignore errors from copyout() 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d0adc2f283ad5db6b568ca533a056c9f635551cd Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d0adc2f283ad5db6b568ca533a056c9f635551cd commit d0adc2f283ad5db6b568ca533a056c9f635551cd Author: Mark Johnston AuthorDate: 2023-12-26 01:41:32 +0000 Commit: Mark Johnston CommitDate: 2023-12-26 02:04:00 +0000 sendfile: Explicitly ignore errors from copyout() There is a documented bug in sendfile.2 which notes that sendfile(2) does not raise an error if it fails to copy out the number of bytes written. Explicitly ignore the error from copyout() calls in preparation for annotating copyout() with __result_use_check. Reviewed by: glebius, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43129 --- sys/compat/freebsd32/freebsd32_misc.c | 2 +- sys/kern/kern_sendfile.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index 41f456d67e5b..f2d66cf74b2b 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -2195,7 +2195,7 @@ freebsd32_do_sendfile(struct thread *td, fdrop(fp, td); if (uap->sbytes != NULL) - copyout(&sbytes, uap->sbytes, sizeof(off_t)); + (void)copyout(&sbytes, uap->sbytes, sizeof(off_t)); out: if (hdr_uio) diff --git a/sys/kern/kern_sendfile.c b/sys/kern/kern_sendfile.c index dfdf01f45e34..f6f6b57adfc7 100644 --- a/sys/kern/kern_sendfile.c +++ b/sys/kern/kern_sendfile.c @@ -1328,7 +1328,7 @@ sendfile(struct thread *td, struct sendfile_args *uap, int compat) fdrop(fp, td); if (uap->sbytes != NULL) - copyout(&sbytes, uap->sbytes, sizeof(off_t)); + (void)copyout(&sbytes, uap->sbytes, sizeof(off_t)); out: free(hdr_uio, M_IOV);