From nobody Mon Dec 02 01:46:18 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 4Y1mpg00PBz5fL7X; Mon, 02 Dec 2024 01:46:19 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y1mpf6DC4z4j8p; Mon, 2 Dec 2024 01:46:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733103978; 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=XZRghMlscu7m14ktN2sqlryxgCFNi1TEzgYeqQ4AjOk=; b=Xv5g9fI1m+nCJL2S7pMUySCncz0pvTg/uwJ7k50wPlv5kLZBFaqhV+e4HkQgt9E7ut6B0L XEmJSkkJBWQEWCIdNFh+s1AXhsmqoGzs3IBzSVAXSPSfFxGi3H4XtcAHiyVOGuDTvHvHVS kKferjrXl0UhHQTdABDXe1FOVIz5Rne/udTTBh9c5GLhvOqaSxYfx4iPp2hVi6ceWQSHef 9aIY+TXMfcNIKERFileJ0GaaQ2sSXm9AWG6Zv3u20iVVsZd0cQdnZuiQ1qSV3oaAY+miAs NNFqeJgjgJCSlAbHPqiMFuy+XbVKcEfmyvHbWWKGupHAuKf4XLG76WmrkP0HkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733103978; 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=XZRghMlscu7m14ktN2sqlryxgCFNi1TEzgYeqQ4AjOk=; b=AW2P6dPt6XfrbfRhpVNsyCceMCwGVws+Is3X5JqoG9L6LRraw7y1an034+nEg3tuLacGoR BQMuMkguR6tYextInjb+hZXvSgFAXMwMokraSKzQEVZNPCBgIRJB0U4PsIiMi43kexdgV3 93DjdNKovTLU50DVOqJqw4E453u8+mWIMvKbz2gPqIv35LSlAarGcOAh9zQqk9EJv/7lt0 zJqkOngk5l01lrJW5YU0MT0AIEgjEH34+VRkaQBwgoBijzfVzL5pDvKV/ZAFgpLLf5wdl6 SBNZXz8qBUKGw6YCLrc+y5UAFv2zQRfVpkOG/TYTtCsqJkdT+CE6GjPi1+N4kA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733103978; a=rsa-sha256; cv=none; b=fsW/+sSMP+7WNRcKMmSvy0/oA/nVUSy6tof/qOarGBTSQp/ORKgCgGcnF+F/5ZdbjlCrfP O/6tk9bYTM3vHb4MDxIDfroDwy9nMwOo03dgLfN3Nn0lvliFMe3+oEiNP7CnMLBx+nUz6v hTrA40g5H6qubCx+/Te7Nd5axz9rH6TEmAEC4kw6p070DG8G9LWIT/EtmNjUgPGlXOLZXO A344byRj5lcWSbqwnam8vQRtaCiT8296T2gr1MNlSLbiL5n2cw7CWZRsJk+2lmKgVJoC0f QKrzqSk4GLvym2q9GaLi0qHIvVTkev2w+Vta+0JXDgawJ8FNq7khx0eial+Hvw== 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 4Y1mpf4wLKzJ7K; Mon, 2 Dec 2024 01:46:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4B21kIWB026579; Mon, 2 Dec 2024 01:46:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B21kIdN026576; Mon, 2 Dec 2024 01:46:18 GMT (envelope-from git) Date: Mon, 2 Dec 2024 01:46:18 GMT Message-Id: <202412020146.4B21kIdN026576@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 057da12eeaa6 - stable/14 - kern___realpathat(): do not copyout past end of string 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 057da12eeaa6700793340ffcfede620135b7f540 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=057da12eeaa6700793340ffcfede620135b7f540 commit 057da12eeaa6700793340ffcfede620135b7f540 Author: Konstantin Belousov AuthorDate: 2024-11-25 12:41:46 +0000 Commit: Konstantin Belousov CommitDate: 2024-12-02 01:44:55 +0000 kern___realpathat(): do not copyout past end of string (cherry picked from commit 67218bcea847c93ccd002335748884b02a3ca807) --- sys/kern/vfs_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index d48c1c0be80a..aa6141cb0230 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -3203,7 +3203,7 @@ kern___realpathat(struct thread *td, int fd, const char *path, char *buf, &freebuf, &size); } if (error == 0) { - error = copyout(retbuf, buf, size); + error = copyout(retbuf, buf, min(strlen(retbuf) + 1, size)); free(freebuf, M_TEMP); } out: