From nobody Mon Aug 07 14:24:14 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 4RKJV65WfYz4pj1w; Mon, 7 Aug 2023 14:24:14 +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 4RKJV63Hr9z4Kw5; Mon, 7 Aug 2023 14:24:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691418254; 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=AXCS6ORZGvLvla/VsM4Tz8jN3DP3evX3zrXE0bN0V9E=; b=CWkP1Yc9YtGwLWcgblbdSXRTNWaQc6YjcOaCyvl+IwyaLl3XrIA8y1km9dynRC4jDxFcMr L9aBLTShsXSQrDgCo71lSbnHMVegkv9oHRVg3fyKN1hgEkkgyELDuQWMf6YfideKlQR6MJ nqamHis+DWAQX5d5bgqeVU+XGTY1eRlmyzFE/j+ZQAPyFbs2tx66UtwwRIBqt10p+jsCfu q8rUlVJ8Zlbf+MkN1qw9ALeZvLf88oWVyWwVgdn17LN07dr/lHS7yfQXPQS/GIpurYNnUu M8M8OwsSNRT2VBC8X2aAZ/ts6N197M1X38l6klEv2oINbpCGHkqedzvFecqn3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691418254; 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=AXCS6ORZGvLvla/VsM4Tz8jN3DP3evX3zrXE0bN0V9E=; b=XiDWy1sSwcTMLNatGJruE4zZmYb/HEkjvL3mdDxVFghZZmrheyh4KYChVm86D4PLvBGd+7 MZ1snhYw8etzBQ/7LGWsdLXYKlj/1A7Yt+1YYjv3uwR924ZJHMEru+MgA1fj/lOYxDfF3i PD8offpEjY/QJIFmtyqBIp6yEF0JnhtKTKRZas24B40AJBvoMgfydmKuXPSIAPTb971Bqc HkPENBYYJ/J18kf4x26w4p0iNi7skG1tuHYSCXdHE5CJ/OHfM60tZ4b4ygEmdpwe3ZV0Fg 2Lr9T/dphFuTG4/ofAQeM26IbH2cFbLwQ/MByfJaochUnHq0YHqR2fM00aC2Gg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1691418254; a=rsa-sha256; cv=none; b=VAKX8lb7kn4AVUvycVrTHZs+sVYhhdkNV4WE9AZMTD/RLjeq6yRRgC1jC1+xDeAsAvbznG iDcrsESQqUqWhF+c0zTFVMShiZ+WIyOXX1H2fsmMOUzyRseo2FK6ugSYxjvkEFpdDh3GfE 4JSNUTzlofyfdxrDKXsysINHpzbGEDfDElUtpPQ7sbOtiV3Mc90DSuGv77yoThfkBvyi4E KdOfIDnL4n0VhQuo2XmTwG9N5i86M5fBXXwoBdprKFRyED2k0lSq86IHQGUeRcLuWOFm9U KtOcbv3c3afp4A8GdYBdOpYKl8d7oRQBgtWyt3jdZHJbIOFltD5Ys6faBXZE7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4RKJV62PLNzvyw; Mon, 7 Aug 2023 14:24:14 +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 377EOEsr025803; Mon, 7 Aug 2023 14:24:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 377EOE5q025802; Mon, 7 Aug 2023 14:24:14 GMT (envelope-from git) Date: Mon, 7 Aug 2023 14:24:14 GMT Message-Id: <202308071424.377EOE5q025802@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dmitry Chagin Subject: git: 4e15e32a60b6 - stable/13 - linux(4): Properly allocate buffer for kern_getdirentries in readdir 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: dchagin X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4e15e32a60b601f6e9b8eae7902ff8e958a62933 Auto-Submitted: auto-generated The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=4e15e32a60b601f6e9b8eae7902ff8e958a62933 commit 4e15e32a60b601f6e9b8eae7902ff8e958a62933 Author: Dmitry Chagin AuthorDate: 2023-07-18 21:44:15 +0000 Commit: Dmitry Chagin CommitDate: 2023-08-07 14:22:58 +0000 linux(4): Properly allocate buffer for kern_getdirentries in readdir Looks like prior to ino64 project the size of the struct linux_dirent was greater (or equal) to the size of the native struct dirent so the native dirent fit into the buffer. After ino64 project the size of the native struct dirent has increased. Spotted by gcc12. MFC after: 2 weeks (cherry picked from commit fc1c787aa0157090e765ebba484e6e290e99f177) --- sys/compat/linux/linux_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 3dfea8946e33..0def70e70581 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -603,7 +603,7 @@ linux_readdir(struct thread *td, struct linux_readdir_args *args) struct l_dirent *linux_dirent; int buflen, error; - buflen = LINUX_RECLEN(LINUX_NAME_MAX); + buflen = sizeof(*bdp); buf = malloc(buflen, M_TEMP, M_WAITOK); error = kern_getdirentries(td, args->fd, buf, buflen,