From nobody Fri Jul 21 08:58:21 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 4R6k3y1N2jz4dPk6 for ; Fri, 21 Jul 2023 08:58:22 +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 4R6k3y04v7z4JkL for ; Fri, 21 Jul 2023 08:58:22 +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=1689929902; 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=28dOa6yTx/6+ZLZE0Jd7XmqvcfMKnDz26vEpZbEQ7xE=; b=ZR9iwyoRxtUI61NMBK9G7RPIlYzHP7bwyZAH7MHHf3IjbH0ZwRQ8VBd/tLnjtXAdwB7D5q kmvN9KDy5NN2QoOu6NPctT+Vc9paTEsKmPYA/jMTo3HbVFJ43pAahle5KG9+GSQ+fE5h/3 tIuTEI4YUGH80N6BjumOLhiAPv48TvO5FYh8OXKHWHmUpuFM/A9dFuUb22gyyIcjpugFGH 7KxzXreixFgpAF+BUR9AW/oykEtVZIffcJA7uT9xck8r/AQiVyWsdO4FUZLWJ6l6B6ZnD1 4MYLG5vpAyjWpD7eZcw2zYYZxwuTlp+JW/dyeF1Sqitay5KXS2kCzyi4HilHZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689929902; a=rsa-sha256; cv=none; b=bPxYzywdbcsl23yasNE2huftYmyIGe0BxPuWDBxCciT8ADmQN7MDizATOk+AVBd7dIgOIH 1BkN3l57bQROcrl5aij7z0B1HHd/DpGO90MCCAzz5lp6cvwBQ6iseE4FiirxECgrGPmjfV 7dGxJGnt29xIQPspZtFypWYFF9n/GOsJtwpRqzkRaNx1AgxdM/G82UPHSQnmmgOGBX5EFS 7HsMFii4CRXAHq7UGrh0ASXefIzZKeCs+c8cB+5VMmx9oxKx7Wn4O0hVVglo+cP0pLS/XJ M3UeH9GnxXMEyW6rSYxsHXmdEFl1EAjJBssYHAIlqtwevPhc8ItEUg6Yh4Xwaw== 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 4R6k3x67Zhz15qd for ; Fri, 21 Jul 2023 08:58:21 +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 36L8wL7X024241 for ; Fri, 21 Jul 2023 08:58:21 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 36L8wLVC024239 for bugs@FreeBSD.org; Fri, 21 Jul 2023 08:58:21 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: Fri, 21 Jul 2023 08:58:21 +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: Closed X-Bugzilla-Resolution: FIXED 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 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D272474 --- Comment #7 from commit-hook@FreeBSD.org --- A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3D99544e13eec1586552470bd9d5f3b2403= 8891401 commit 99544e13eec1586552470bd9d5f3b24038891401 Author: Robert Clausecker AuthorDate: 2023-07-12 18:23:21 +0000 Commit: Robert Clausecker CommitDate: 2023-07-21 08:57:32 +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 (cherry picked from commit 4da7282a1882fc03c99591c27d44a2e6dfda364b) 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.=