From nobody Sun Jul 16 17:37:08 2023 X-Original-To: bugs@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 4R3spr4Wl3z4nBvc for ; Sun, 16 Jul 2023 17:37:08 +0000 (UTC) (envelope-from bugzilla-noreply@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 4R3spr3Wk3z3tt5 for ; Sun, 16 Jul 2023 17:37:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689529028; 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; bh=bD7RKdOYutY7HpScW5B/5nExIKFJDNGWBW8ef5h8ELw=; b=Tzon9/TpOKNT1anfkk2cQ1Ml27l3DVHKFLHt4H1Sb9t24e4dfBp5dh+pKmYTf2KnbAFZZF CzJQh/5CQjYz8Kbjp7riFjvzqwqNWLt3iVLTF7sT/kgwZoKjLAJAubeBo1fSSMQyW1QTmw Sbe/5H7MJE1xHsvEQPDx46w7xW2eM0xx8yAEUCERSdJqCh/i54VUr3+NERlJz9GKzs+9nA yVCfRt1HxuYq4D8LXFZvo2m5KCzCMmXDfpxduff/6bF+H03+zoI+FettD3jN0w8ujFFng8 EHTNcYxB5nrOKJRXZJUK+cctDyeJ7P75qH11NmVbmErMPP7NCyreJvoPqOpKcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689529028; a=rsa-sha256; cv=none; b=TRsg3vKM4do5g0y02bgDk0SIwuX0nNap2Nt8w3Blmh0EBdfuoavgKVf5aamqtQN92djsxF 1CgSvHd/3rbGujgZB65yVTrTL2nl10k2k0qqPK2Zx5axxF6sYATCSJsPFkQMDVTPmXf1Uh tRasdZgO55ZjsfTn3UDm0ObdPGaX/c8pD7shG6Y8NhaMDKBPFp/+sGeVAnLaB1qQ3l7n32 l240rgCQW8A8fchPOAOIgBBl6D8fdpiTxOcREUNQYCOdgxYCfjTwyUJJv1SpqseLNHKUnN sJjPtfGttHD9f7vATRqH0lvQmuwB0qgIZ3wnpBRGpa6H+eN7tyoOJC/SysigQA== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4R3spr2Xdpzrfx for ; Sun, 16 Jul 2023 17:37:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 36GHb8Tw057513 for ; Sun, 16 Jul 2023 17:37:08 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 36GHb8eH057512 for bugs@FreeBSD.org; Sun, 16 Jul 2023 17:37:08 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 272474] lib/libc: bcmp may give wrong results on LP64 systems Date: Sun, 16 Jul 2023 17:37:08 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: mfc-stable13? mfc-stable12? X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D272474 --- Comment #5 from commit-hook@FreeBSD.org --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3D4da7282a1882fc03c99591c27d44a2e6d= fda364b commit 4da7282a1882fc03c99591c27d44a2e6dfda364b Author: Robert Clausecker AuthorDate: 2023-07-12 18:23:21 +0000 Commit: Robert Clausecker CommitDate: 2023-07-16 17:36:17 +0000 lib/libc/string/bcmp.c: fix integer overflow bug bcmp() returned the number of remaining bytes when the main loop exits. In case of a match, this is zero, else a positive integer. On systems where SIZE_MAX > INT_MAX, the implicit conversion from size_t to int in the return value may cause the number of remaining bytes to overflow, becoming zero and falsely indicating a successful comparison. Fix the bug by always returning 0 on equality, 1 otherwise. PR: 272474 Approved by: emaste Reviewed by: imp MFC After: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41011 lib/libc/string/bcmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --=20 You are receiving this mail because: You are the assignee for the bug.=