From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 60A17384AB6D; Mon, 27 May 2024 14:42:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 60A17384AB6D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1716820927; bh=Enuro48YCdCRxEcGF1WDe87V45INl4heqUNCSILCZPA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Y3ZcEwL61YpEbw3u2Rph2iC/TfzFU3mlqheKpR2vY/7d+4WqjganlxPTFdFUjl55w JESDQfIEfIBjd+ix68SyMDrRK8FSoJDGanmd7+NEWwvACzq7baBoER1IDHYPqb/Ujb +Vu+3L17VQVViAlsjLOGGcgkJz9vOkmsf+ZhfWsc= From: "cvs-commit at gcc dot gnu.org" To: glibc-bugs@sourceware.org Subject: [Bug libc/31798] pidfd_getpid.c is miscompiled by GCC 6.4 Date: Mon, 27 May 2024 14:42:06 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: 2.40 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: 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: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31798 --- Comment #3 from Sourceware Commits --- The release/2.39/master branch has been updated by H.J. Lu : https://sourceware.org/git/gitweb.cgi?p=3Dglibc.git;h=3D9f2b100d6705b9bbb25= 206b53e80d7759644e06e commit 9f2b100d6705b9bbb25206b53e80d7759644e06e Author: H.J. Lu Date: Sat May 25 05:13:41 2024 -0700 parse_fdinfo: Don't advance pointer twice [BZ #31798] pidfd_getpid.c has /* Ignore invalid large values. */ if (INT_MULTIPLY_WRAPV (10, n, &n) || INT_ADD_WRAPV (n, *l++ - '0', &n)) return -1; For GCC older than GCC 7, INT_ADD_WRAPV(a, b, r) is defined as _GL_INT_OP_WRAPV (a, b, r, +, _GL_INT_ADD_RANGE_OVERFLOW) and *l++ - '0' is evaluated twice. Fix BZ #31798 by moving "l++" out of the if statement. Tested with GCC 6.4 and GCC 14.1. Signed-off-by: H.J. Lu Reviewed-by: Adhemerval Zanella (cherry picked from commit f981bf6b9db87e0732b46bfe92fdad4d363225e8) --=20 You are receiving this mail because: You are on the CC list for the bug.=