From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 8AC003857C4B; Fri, 2 Feb 2024 13:26:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8AC003857C4B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1706880377; bh=DPNerNy29rbRm8x3n/FLrAlGxkzDypp3qvw8A/fVYX8=; h=From:To:Subject:Date:From; b=Yy+xXeVn1wRqEG6b6ajd23KjfbWmw2biNk/EpEZ4JvbK+agmnQOnzy37nQM2ga5W/ XohWys+3kAOPA4qJlPJgOAp4fX3eceI848qbRZr4dr/Z6Gw90Zu6TI6BV+Y6IvYbUS AD+jsgY2gQeRPWoZ1AXPqAGc6IO/RrzfDPvIHo0M= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/release/2.38/master] sparc: Fix sparc64 memmove length comparison (BZ 31266) X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/release/2.38/master X-Git-Oldrev: 0e383d2d4e7c08b36ad3edb30c072a3dc4d26ed8 X-Git-Newrev: aac57faf5425b472a72132b09f4b3a2aa1f77a63 Message-Id: <20240202132617.8AC003857C4B@sourceware.org> Date: Fri, 2 Feb 2024 13:26:17 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=aac57faf5425b472a72132b09f4b3a2aa1f77a63 commit aac57faf5425b472a72132b09f4b3a2aa1f77a63 Author: Adhemerval Zanella Date: Thu Jan 18 10:52:18 2024 -0300 sparc: Fix sparc64 memmove length comparison (BZ 31266) The small counts copy bytes comparsion should be unsigned (as the memmove size argument). It fixes string/tst-memmove-overflow on sparcv9, where the input size triggers an invalid code path. Checked on sparc64-linux-gnu and sparcv9-linux-gnu. (cherry picked from commit 926a4bdbb5fc8955570208b5571b2d04c6ffbd1d) Diff: --- sysdeps/sparc/sparc64/memmove.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdeps/sparc/sparc64/memmove.S b/sysdeps/sparc/sparc64/memmove.S index db6f4f0e84..62b19ebc1b 100644 --- a/sysdeps/sparc/sparc64/memmove.S +++ b/sysdeps/sparc/sparc64/memmove.S @@ -38,7 +38,7 @@ ENTRY(memmove) /* * normal, copy forwards */ -2: ble %XCC, .Ldbytecp +2: bleu %XCC, .Ldbytecp andcc %o1, 3, %o5 /* is src word aligned */ bz,pn %icc, .Laldst cmp %o5, 2 /* is src half-word aligned */