From nobody Sun Nov 22 16:43:57 2026 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 4jXZf82MVyz72CBj; Sun, 22 Nov 2026 16:44:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jXZf81nj4z58SL; Sun, 22 Nov 2026 16:44:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795365840; 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: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=jq92onYjqOsFgRcFUJ2F10uMD+Urut8JHwCoxaFkIfc=; b=JXymouSe14vwGCLe/jKzd63/CSjJMvzqcrZ480aMq0oA9OkTtznD9n7Yfx6p3OPbUBZQy7 h8tKcvP15FNNJ2i2suOLk44AdYVxDLxv94AHZo00u2p3Ka5arNXgNNb5vGzM0HZkWRswx0 UltNw98DiGAa3/It265I8ktYZOMMNvvam4w8PUrpf6GHVp/7dADqRqw86IfRbOaRIteJtT ThXyxDkdao2ey7Fq8DYxatS81Efhtq6Y7CD0XZ0R/kOmWBojrIA19NkU6w4a88ZbS6Rgrm kNjNnUIrHMkbFunCyf/VUgHS428othTNGpiCN/XJpaLZxWTkeU84pVM6MYPiFA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795365840; b=bNM93YmJuDy+TFFRXN6UuiDUPatHp57cF+V15UWaM7HzY2KQ0v9j3SpGKRzdrxbl5AifqM jAiUG7veQ0xKtP+Pfl0fZoYpwrB88uQPbPbsj3tVa1XeYmqGmp2hVgd1N90Wr5/Cpj1dkn Dpdp5M+cqa+yJ6DHxpiVS7WpIdIvbmfxa3A7iRpBItKRx1bURBozR/6ejRUlh6C/dJfycR J/vFct+o3Ajjqi3IpasQ8N26E/5qDMXKuSCoFIEWAc/NXf/zPHEkFmhZLY/wsjdJDG+QJ8 zlQlag/vwSBqijnan/1mRdr+zEoBYqqnJmJbUWFWzScQzohXLYjjAV4Ow/rHow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795365840; 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: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=jq92onYjqOsFgRcFUJ2F10uMD+Urut8JHwCoxaFkIfc=; b=NpK6caPhRZz7H2qUYZWGdO0keioj+R0woCnQ4KM8jPaIBOxPgbQ7sZkX+ashf79VL5DYeP TaRn4tXHSBRqaT2vbMs4H5PsZp08wp9keiqVrBIDkNYp2seFNUFzmQ4JNNU/rNw0G8fAIW XZ+MdxVEq2gKGJ5cn2aNGpkshzS7pX4d0Qpb6F4sCIDfnqaeqOeBgjsczuiC1lfhfdmEtm 5osXlMa6zbNybrwaqsdk7ZA/Ff2G4YIOoLz73VAGyk+hnA9jod3n2xCAVaVysUo6wasO7u jqBijHZqGGWYKugXZnvTEfIUHt5guEnvOMT7ECvJiRQIDQ/xcwpILNrYRgBQJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from [192.168.0.88] (unknown [93.188.39.137]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: avg/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4jXZf751Msz18T2; Sun, 22 Nov 2026 16:43:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Message-ID: Date: Sun, 22 Nov 2026 18:43:57 +0200 List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Fwd: [postcr] 2 possible bugs in 11a3bc02374b ("libc/fnmatch/rangematch: fix uninitialized variable read in a condition") References: <179536524656.9159.6953635216198722743@freebsd.org> Content-Language: en-US To: src-committers@freebsd.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@freebsd.org From: Andriy Gapon Autocrypt: addr=avg@FreeBSD.org; keydata= xsDNBGcKrHEBDADRvwQOK0b/yo4ys5cs6bOQMhEh4xtfbaZ/CU00cpPgUip3sOZCdrtMWlRC g25z97prxE9pKueZi+HXDhIPpa9xl14ghqF4oYScuJ1i18HyiOH2y5Q3Vv/TtFiSzicd3EAu QgS3jVidpgDSPDdj2Yz3UxYpZ+PuFl6nOnvCvqOFcjUlzKCyPaiN2b86l1Nscmhnc+zQ/faB erUOEFEDQbWMA5YfXi8HrbeR16hfRfGt7E0aMDlIj9FIPIq71UWMN9CimPgs4+rbNr1MAlLa z4GxSDhVYZEY5rqtCzr+PLXboRQWnaUwXl0/biw9enf17NHdYv1SNAFTX2eC4dZ3qBVI74dS PgNprm+PMfz+6Hhs/dAv+Nan5nVhg3EFIjYTiy0MnjMSq8uI0v0ykpAGAcJJ5xl6d23aLxgN 6f0z6pJRCO0hGPgU7UzvFD0MxJxmbzqdT1R51KDan1oD41b+tjl2LMBuCDCoB0U44Pu0zLdp xMfFTxCXtwIYKIUxwd28jwMAEQEAAc0eQW5kcml5IEdhcG9uIDxhdmdARnJlZUJTRC5vcmc+ wsENBBMBCAA3FiEEmXvSmjiQFHPVOpLnzDOt5NLj67sF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H0xaBYaSH44CDZDQDg4LNcmbOvuu1TEXBJhjQARAQAB wsD8BBgBCAAmFiEEmXvSmjiQFHPVOpLnzDOt5NLj67sFAmcKrHMFCQeEzgACGwwACgkQzDOt 5NLj67sUCAv5AXqgWnYN9EblapMbZjkiqL8pZQ0GNqh+Pg9FwbyULxjtRTO6rD4D0IxizByb ef+neeUNyYlagt5nfKMysEr0SU/gHKCi8vyTF/63ukMrGUNGmJJxrndl5ZYKC6j6eX7twrZF L1Uvlmn6FnQ22red5kHO93fDjG4zaDIZvHfwj7kzjZ4tpC7Byinf88s14mdZeScc0PnU2hj4 UGYju/wg2FF4YxaZYhcmdTiRYY0Wx85XSMZv19pnn78sadEuRvfRd4JTmw++j1xGXeqQGWzz /CTG5/Ex9GAkQ02hZbmi236byDXoet4G8TEyOph9QFVkV9bNd0jQZaFZPGEj4PSPUYGAF7s5 xJaNGgctC3aZ7WjEv1FBoo44XCU4xcjJ1wZQUrHxRhx6TW0Jtcl0U9qfKFW30TSPo6RyiXuj X4ltWKAtjoXB8nUmEJckaz7IRu2b4pXDeazZuz5JBygUs10yJjDxh2vFQZo0KaBAPx9MZlPn gpPTjT15L8xGftEjQXF6 In-Reply-To: <179536524656.9159.6953635216198722743@freebsd.org> X-Forwarded-Message-Id: <179536524656.9159.6953635216198722743@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit I've got this feedback from the post-commit "AI" reviewer. I think that those are valid (pre-existing) issues. But I do not have time right now to work on them. -------- Forwarded Message -------- Subject: [postcr] 2 possible bugs in 11a3bc02374b ("libc/fnmatch/rangematch: fix uninitialized variable read in a condition") Date: Sun, 22 Nov 2026 16:34:06 +0000 From: Post-Commit LLM Review Service To: Andriy Gapon CC: Mark Johnston This mail was generated by an LLM (claude-opus-5-5). It may be wrong. Contact Mark Johnston with any complaints or suggestions. Please add the following line to the log message of any commit which fixes a bug reported here: Reported by: llm-postcr commit 11a3bc02374b6517e9bfcaaf68c9b5b9902c043c https://cgit.freebsd.org/src/commit/?id=11a3bc02374b6517e9bfcaaf68c9b5b9902c043c POSTCR-11a3bc02374b6517e9bfcaaf68c9b5b9902c043c-1: pre-existing: rangematch() end-of-bracket skip loop ignores backslash escapes, so fnmatch("[a\\]]", "a", 0) fails and "a]" matches This commit does not add the bug. It is an older bug in rangematch(), introduced by af79566b9315 ("fnmatch: Add support for collating symbols, equivalence classes, and character classes"). Since that commit, the main loop stops (break) as soon as one element matches. A separate "go to end of bracket expression" loop (fnmatch.c:460-485) then finds the closing ']'. That loop does not parse the pattern the same way the main loop does. The skip loop does not handle backslash escapes. If an escaped ']' comes after the matching element, the loop takes it as the end of the bracket, and the real ']' is left behind as a literal. Before af79566b9315, [a\]] matched "a" and "]". Now it matches "]" and "a]". [a\]]b no longer matches "ab", and [!...\]]-style patterns end early in the same way. This is visible through find(1) -name, .gitignore-style matchers and anything else that calls fnmatch(3). Suggested fix (covers this bug and POSTCR-11a3bc02374b6517e9bfcaaf68c9b5b9902c043c-2): loop on special != 0 || *pattern != ']', and when special == 0 and FNM_NOESCAPE is clear, skip the character after a backslash. The reviewer reproduced the bug with this tree's fnmatch.c built in a harness, and on the host's 16.0-CURRENT libc. fnmatch_testcases.h does not cover this case, so a test for it is worth adding. POSTCR-11a3bc02374b6517e9bfcaaf68c9b5b9902c043c-2: pre-existing: rangematch() skip loop stops at ']' inside [.].] / [=]=], so fnmatch("[a[.].]]x", "ax", 0) fails This commit does not add the bug either. It was also introduced by af79566b9315. As described in POSTCR-11a3bc02374b6517e9bfcaaf68c9b5b9902c043c-1, the main loop breaks on the first matching element. A separate skip loop (fnmatch.c:460-485) then finds the closing ']', but it does not parse the pattern the same way the main loop does. In the skip loop, while (*pattern != ']') is tested before the special state. After "[." or "[=", a ']' at the start of the symbol's contents ends the loop. In the main loop, [.].] is a legal collating symbol for ']'. Suggested fix: the same as for POSTCR-11a3bc02374b6517e9bfcaaf68c9b5b9902c043c-1. Loop on special != 0 || *pattern != ']', and when special == 0 and FNM_NOESCAPE is clear, skip the character after a backslash. The reviewer reproduced the bug with this tree's fnmatch.c built in a harness, and on the host's 16.0-CURRENT libc. fnmatch_testcases.h does not cover this case, so a test for it is worth adding.