From nobody Tue Jul 18 21:44:54 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 4R5CCp4KKWz4dTNs; Tue, 18 Jul 2023 21:44:54 +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 4R5CCp3vtBz421V; Tue, 18 Jul 2023 21:44:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716694; 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=nvfVXNjhy3rZ4UinJVL1qL8kauxVG1m/hVWSH7sQvLM=; b=B9TInihoGHrGOnjss1h5ToRz31fbWEeCL7RJ+KMv4UOsoGMLugPbw3Vvcc9/ePrmGHC0GX A2rGQ+oRePynALciAQlUZpjDf1xqnzUV9Im4h1o4c2thFpgGNSh27qLFosCSsLalJwFZ8i 25jWtzhpE9XBSiOL3b+sw/fAP9Zain4rAd9/rnhLj5IivmUtxF7i0mbxK40EJGc+NMEoeh 95kXDX66mdZcJvDBH8AJgEDBQkUFpBOQ1lh3CtAMPiTmrGU42ZRbEwdU9Zn0gyVUNbrVob hlsyddfTbWIlIMivfceGCptXm7prrpRY/BPw0TuNL9cCXvz+mor7mJ+DsU12cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689716694; 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=nvfVXNjhy3rZ4UinJVL1qL8kauxVG1m/hVWSH7sQvLM=; b=JEGMll3+TVmA2bRtQoQVoKd8C94F89vwByMcmpAW+nkmygBoCSVdnfmiEjpWQg5i34MLhT ZKzE/DWNd6dPziPx0F7J8404KauhOPtdLbmIFfKu4Xl/fhLBMqXEJvLC57y1wLHbuUZDFK h6s5PUgEdAXSuw/x6goVGxiFa8RnYhzADCfmm8Hk7kCyXzDd9KdkaYmnsf7VUg5PLfIIFX 9muL71xrel+z6/VzwQDvSGChkdlrDMDCxvI9LaUU/mcumrq1JcHDzU1q9kIvGNoWegYjk/ XzLIZn5XKB+OnWrnITob3hIGGGAcycNeKPiglQkskNaSdm4ejDC6GYTQaCWaFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689716694; a=rsa-sha256; cv=none; b=KbfGolJcsF+oZM6qBWY02C60Cq53zHziG1ljmdyUaguMLmcojF6vgqLXfkkdSgTKP43iNp NZoYnnp78ivKs25iaatOvTCXlHIT1Yo6rcmkCrCRreAlpu42jGoEO0L7fEztNOaWesGfgF DMndBnITprXWgV42+x8AtiEeUNFPwxh9jIToaENeg2fxu5WE79xfJlBvxjkgYcvFOR9XZE G0w0BB4vT65pm8Nmf3RRi4DjRe/1xiUr/hNvqp/D5pjSINIZTH4DQP1kAJ24n9rVlm9h62 zRAKCMSYO9X8G2PdsoQhUkuJ/oVBEMS7jqp8KdkIm3vWLCqSxYwTBoE6ZGQ1WQ== 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 4R5CCp2zv6zMKG; Tue, 18 Jul 2023 21:44:54 +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 36ILisso061790; Tue, 18 Jul 2023 21:44:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36ILisGM061789; Tue, 18 Jul 2023 21:44:54 GMT (envelope-from git) Date: Tue, 18 Jul 2023 21:44:54 GMT Message-Id: <202307182144.36ILisGM061789@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Chagin Subject: git: fc1c787aa015 - main - 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/main X-Git-Reftype: branch X-Git-Commit: fc1c787aa0157090e765ebba484e6e290e99f177 Auto-Submitted: auto-generated The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=fc1c787aa0157090e765ebba484e6e290e99f177 commit fc1c787aa0157090e765ebba484e6e290e99f177 Author: Dmitry Chagin AuthorDate: 2023-07-18 21:44:15 +0000 Commit: Dmitry Chagin CommitDate: 2023-07-18 21:44:15 +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 --- 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 4e8c3f435261..a5b8a4270dc0 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -560,7 +560,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,