From nobody Tue Jan 02 00:37:23 2024 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 4T3v7m0k5tz55ygc; Tue, 2 Jan 2024 00:37: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 4T3v7l65Czz3HwZ; Tue, 2 Jan 2024 00:37:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704155843; 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=WTWVCNi6yc07ZimML4GYBQBJnuSigA77IXMfycAtVLk=; b=UozJJJmdR0Plyp0Tr1AlEzs7kLpz+LXDGOnH1WeVJ8nMlyOpx0wjxmP6dWyR4KG1LuplCH Yn/e+95cVKt8vB9s1wslHb7dG2qPLn7cVAAY1iOj4IFnAINYjs6XjYZZURLKchZp/Ax3Lm BqTFFj/TKhiSE4u2efJSf778x6IKcLUfArBGiVvMO5jaym1R4nerJkj1T36yrMLVQgHRZa DdtROJ1UM3elzzOpl5219nEeLPtVrghNEge/M/qI5Li0mWo3aqZKS5RSBNeys+ju7EX7k8 /qz554eqFbtBo98xoxhgIhwPW1KTWZ9i551UCbbMBV+RVeYm/EgFnU4nExcB1w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704155843; a=rsa-sha256; cv=none; b=Eboo+tTktH5F5gMQ3Kl/iMpODZp194bs4zR8RTg//qdlQ5Rp+uYdnXlCxy7NhRUsA41lxz /WQxkZ1kjwcZ3T5FKTGUeCkZVNFXLotMstiSKkseOZc1WeL/x9l7a0HUC3s1Lae8KwCxRr PyWSnh+vbTeWYyMvI2xawOf4/txhweb/DhHBdfWkY9nmEXgQW1ZaPsKMUAYibD8Owgxp3Y QQ6ukstjWvY33yByz3r/hwgblXiT+wKO9da+y725949FzPkXel1oVHr7vXFUwoi0dE4Hhb rjhsyePZWSpUq4UCiaAGCB0wpyE06X7O03zKqIiak8GBR75VtAInymFvDCujOw== 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=1704155843; 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=WTWVCNi6yc07ZimML4GYBQBJnuSigA77IXMfycAtVLk=; b=Z2SuraMqxZbAegDTz9GSX0w9FEOJ9nG4eEgQAxlkjrd/Bz3lD4QRDllBMZLOMo9tVbp27n l6+pJL2KhKUmqw4iTwxx5+6UHYqrV0IhkLv0hAjDICgvkldOjWFrt/fFSq2BxJikuQmLA3 +EAOfY6XXXs/AidtdBRpACK1w4eu1/L24Sj+kN8rSqEJpNlT0HtZSm3nxWWtC7TgLSDWn3 EwJChHwjs/A94WFfjsK44giwO18wKVvqwyxrWD8ZYEKMSEicLyEdbi1y8sznDlB6bilRCT 0vIe0Lzttj0Unhjl/Koh1iMcp4QeHSSDuS7E8NSog7QkcLS0YngNJ6/T+odizQ== 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 4T3v7l5B5xzfsh; Tue, 2 Jan 2024 00:37:23 +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 4020bNFt085428; Tue, 2 Jan 2024 00:37:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4020bNLQ085424; Tue, 2 Jan 2024 00:37:23 GMT (envelope-from git) Date: Tue, 2 Jan 2024 00:37:23 GMT Message-Id: <202401020037.4020bNLQ085424@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: c7975edd99b7 - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: c7975edd99b7b47b5a8e4112b3494d1c5bac96dc Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c7975edd99b7b47b5a8e4112b3494d1c5bac96dc commit c7975edd99b7b47b5a8e4112b3494d1c5bac96dc Author: Mark Johnston AuthorDate: 2023-12-26 01:41:32 +0000 Commit: Mark Johnston CommitDate: 2024-01-02 00:29:51 +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 (cherry picked from commit d0adc2f283ad5db6b568ca533a056c9f635551cd) --- 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);