From nobody Mon Nov 25 19:36:48 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 4Xxwv46PDnz5f5cH; Mon, 25 Nov 2024 19:36:48 +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 4Xxwv45qS2z4cpJ; Mon, 25 Nov 2024 19:36:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732563408; 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=sMNe5bVWOAonhSobT7yfp0FZgL+tp/gJ/q1SNKgChoU=; b=OxN/T8z0Wk2SnWvc+5iCtVYOrSKclGM/VoFicCn8sBJXW5vo9GdNShDreFuqjTcvBvIE8a 3PHqhrkHQtxrWnI1xE9AVAL+kP+rVqZpG86LzPQkyTgkyJd5nl182L2vpjnU/bMhmwDcaS dL0Gt5qlQ4PrUulSAWV8wkSWEd2dPBBS+dQcl7We7Qwp1L3GLQsdVqn+Ne1kxLLuWlVUsP gH5w+0lUVBkvcecFRqECBPpX+QsTlcNdNVvuPOK9v1xg8H+hJW4Ajom5jAnCNpSJ3rjteA nKBzxstB3vobJS0bB8GoUDfcWu9P6GwwQozhZ/dTbAwYufuQ3FLvfZMkDYa+pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732563408; 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=sMNe5bVWOAonhSobT7yfp0FZgL+tp/gJ/q1SNKgChoU=; b=fKgNMLPVxCI2ug+AgShyJkha+wf7s8Laj4/8dM0jQnXL0+rt0tAdYlHGkycjUE7g6QmRuA k8O6+g5cS5VGDdMJBU5KHbtKMjfJdf2pBiZQ9hwPSCYU8dFnCsdLhMLhLGvD2Ss5M+dypM H0NrlyYtdsgUDNC2Nr45YspMMj2zt7rR6CI40UH+5MBpuWhnGGQ8bkvqm8StjEz5RlQtPo sAc2e0V4HzEAQbj6iilpl8vzmY3RIlGyhSB2yri8okIciI8SLtAV/zQXhAWiJoo0qt1829 XhVZdpMvblwi1Ijc+BDpK41AEikQg6i4qinygH1BhMcnzOYLsIPn4vFtz7KGWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732563408; a=rsa-sha256; cv=none; b=QrYh1HBWKkXGyfXJXlOudJ24Zo8UIVJ7WnJVmjKN8Xhh/PjxW92IjBpB712efZxlC8z3Rb L/v6nTVBrqiUi9Lma1cHXaZgMkW3/kEdp78uwU4yTJA7osFcQlhtOHJCXDqRsw+ERgvxwI j80xYq60nvKinSmQSKuLQvPbja0oTO8nD9oea4Kq7AvAsp6cR/Dg7c5BVJ7aOvYkguTMo2 PAPn2fde0wwEX46hxVx9KghKI6O5n3ZEroWwqTAJPL+EKGj1UCSa0Vcl9Ic+P9tV52YRkX cDtIlYDzIDqg8hlVOYQ617Yx4NJ1tIe1QBZ+i1hGPvn9Sl1siuEVg28ndySfAA== 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 4Xxwv452hczt1R; Mon, 25 Nov 2024 19:36:48 +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 4APJamuH042144; Mon, 25 Nov 2024 19:36:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4APJamMe042141; Mon, 25 Nov 2024 19:36:48 GMT (envelope-from git) Date: Mon, 25 Nov 2024 19:36:48 GMT Message-Id: <202411251936.4APJamMe042141@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 67218bcea847 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 67218bcea847c93ccd002335748884b02a3ca807 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=67218bcea847c93ccd002335748884b02a3ca807 commit 67218bcea847c93ccd002335748884b02a3ca807 Author: Konstantin Belousov AuthorDate: 2024-11-25 12:41:46 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-25 19:36:41 +0000 kern___realpathat(): do not copyout past end of string Reported and tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D47739 --- 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 c4b4d59f3b40..f7178ee006ea 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -3290,7 +3290,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: