From nobody Fri Jul 21 08:57:20 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 4R6k2n1Jg1z4dPPx for ; Fri, 21 Jul 2023 08:57:21 +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 4R6k2m3KR7z4J2c for ; Fri, 21 Jul 2023 08:57:20 +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=1689929840; 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=BNexrL71xKk8PfhSaJy0+dmkB03KYoU32hWeV4kGzPY=; b=UCHXDgKQZ9CNWDpVolNRJfWMpaHm4vdlRlzMqdx6gUvCG8gEn50EF2WPl0slUzjD9uNAVT 3TeKNnarhWTHWcIwQJAtwIpIT/Hb39fqnh59dQ01BNQtytDnz0j0UW+Mk4lFyGvGOE6E8/ W6IecS0lc+MoSmwSmoXvSCWfxTEorXU9TR4jxbYRyPkbXEWRybHWNXB20EuZWPnSy2UGls gba6u9YvU+ZxD2TdbeshtJTAHe33mQicbnH2rnZrNYWcmgQNLkEDgHQjlDcgeBoceSd6tl l7Isg42hc/44NGTJpjZICZmmIl9AbXYpFhvwFyMwa2t8I83ixuuCZNXex1jFYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689929840; a=rsa-sha256; cv=none; b=WxU6wXFFEpO9e506OWOHNt+fhuPC3tKb+17tLRyfWYGMW69jtTk3IiBUr0tjXpNLwnn1Tq 70Wz2jhpd6hea3iPKQvkOUoaNsVF83vv/7MN3ITy5VvOOcK3T2+x/oZTVCLBx7mqP1AD28 MAsMzjCOQw/RBq7yzMHbh66JwuhPj8ND4k++0nrmllhyZNJzD41oAtDjvcdSqja7D+ac9r kGduJ+kdLpc+TjJG0oZXgjcFh5Es9eGFLgKAve5/FLSTLVGmZY+At6p0WZ0j5Not01WQN+ FdxwHuTO0aGZvsEtGbLNti31cOA2+Xy3Fs5GoE8PZeQrTFg3HjqEDRSa4LGq+w== 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 4R6k2m2Gw4z15SS for ; Fri, 21 Jul 2023 08:57:20 +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 36L8vKw2023852 for ; Fri, 21 Jul 2023 08:57:20 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 36L8vKPS023851 for bugs@FreeBSD.org; Fri, 21 Jul 2023 08:57:20 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:57:20 +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 #6 from commit-hook@FreeBSD.org --- A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3D3b0dacf6fd13cf8688402561192899507= f46c276 commit 3b0dacf6fd13cf8688402561192899507f46c276 Author: Robert Clausecker AuthorDate: 2023-07-12 18:23:21 +0000 Commit: Robert Clausecker CommitDate: 2023-07-21 08:54:08 +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.=