From nobody Tue Jan 02 01:13:05 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 4T3vwx37kGz562nk; Tue, 2 Jan 2024 01:13:05 +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 4T3vwx21ysz3b0r; Tue, 2 Jan 2024 01:13:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704157985; 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=3t7ob61bgAjBBj4T7/W4wlerqK+fvicXWeABfuURh8I=; b=XWBcSKETIETUPEhR3oClVOLKhgg7cUbp45xXEzFW4OCVnUJn2yZ+/b18+LyEwsVZT7Co85 rfv9b+yp0a0txRdJsbZycwjp178ugacL/ZSej87TjtP2bCaTVGYObrTUnmOyYxmoORUTha 9/MAGcbNgTaM5d+GIiP8rYMwZmAHZTCFbXYdDVlu8hVN5WTqmrElRIoFlBKPGwJzDzkneb XShd3EwtC4wQIfwTsWgrzMRFqckmZ/mpKtwOjeTUpo3NH0cZ2lQylC74LYNFQPbHtfaWd0 wm6Axnrej+3JP0ddEzG76a+N7p26c7Jlkam27zF26244J/M3SxyYR4cRKTTHJw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704157985; a=rsa-sha256; cv=none; b=sE3MGbHBRlZvNjyulHOJbm9qdQBJvM9cFUBHObliqS69rWNhkbcPQSER911IUFhRjKRe9R edPbLL6kBtjsn3vTG4B+Ydh6gjbW/ThesDgJq6LSlowN1mGMcbp/0wom3J8ur7qcaQg+Fb rX5S+taSVF69na19YDuXD/6u8LbGsvp4nljlKoRysAaWuNh9ix/c66CcNztmdODEsTKgKG jFqee6+bAP6KJP+uBotfTfiO0CQkR64/BBUKCHUdfs0GqV3shtw5PTBwaBfV/cLFTgSVeB RguzIt46JvEJzNk5EKGZJDOCBbGV6wa4FjdYS3Yi1VFFzc9LuvXtHK9UGt40AA== 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=1704157985; 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=3t7ob61bgAjBBj4T7/W4wlerqK+fvicXWeABfuURh8I=; b=wu+ekfLaIvzMfSwk01yvIKH5r+ga7/LvFsWmnEoeD7TM/y0fS6lWRIbGD6+ojCldMV4n5/ dr7QwHOpF/gY+KixicWNoZa/YZgzv1mUu3dZfAS+r68f5Fkz9TItTsphN3C4Bt73BvBAx/ zrh+DwutrIOfhRpEc+YMMOnMsrawtbRS1Nak+3PUQiDaJm3Lqwnt0g4X84dIsEGdHfgXxW aOkbd0M8Y5AdEui0Z9SIW9DykAKZEApFObS2VDwFSWRs3q6SfLrTO3JNa3IHi3T0KovIq0 hJAIxL4AxKGldyPGXmAxLLd6HkXtA4LZZ8VOJ6jiec/DqD9k4lt4DGUZ/E9Meg== 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 4T3vwx16d8zgc2; Tue, 2 Jan 2024 01:13:05 +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 4021D5Ll055031; Tue, 2 Jan 2024 01:13:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4021D5xJ055028; Tue, 2 Jan 2024 01:13:05 GMT (envelope-from git) Date: Tue, 2 Jan 2024 01:13:05 GMT Message-Id: <202401020113.4021D5xJ055028@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: 3aa79121f2b8 - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 3aa79121f2b8cb070ea9b8a89e6ca8ca967a16f5 Auto-Submitted: auto-generated The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3aa79121f2b8cb070ea9b8a89e6ca8ca967a16f5 commit 3aa79121f2b8cb070ea9b8a89e6ca8ca967a16f5 Author: Mark Johnston AuthorDate: 2023-12-26 01:41:32 +0000 Commit: Mark Johnston CommitDate: 2024-01-02 01:12:45 +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 cd6a4c2dc3df..ee0119dba5af 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -2148,7 +2148,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 8b7a2e7e0ce7..2a34a34067d1 100644 --- a/sys/kern/kern_sendfile.c +++ b/sys/kern/kern_sendfile.c @@ -1326,7 +1326,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);