From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 0729E3858033; Fri, 2 Feb 2024 13:25:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0729E3858033 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1706880352; bh=qDWuM8xH6VFSbZ+/0CsjRTGH1NXf8KiZrZ29o9ullsU=; h=From:To:Subject:Date:From; b=vIRiPCtddVjaUZ/+wrGM8Y0LIcAjUAGBE1JomIaWzfy2Y1F+6lLyKSmocZc9TD4aR RUxaZ3NdwpINUBFjyfc5ba7fKjNMT7Y1MiFKOuswNsZbKhopgGoscSop2pSQR8EyUY AAX0J6rM3ZyVO0CxvUHW8/CFtQsRIVaVaQhbOHbM= 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.36/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.36/master X-Git-Oldrev: b233c4496445f4cfe343ed2d3079a427511a14c8 X-Git-Newrev: f4171ba5e5a772217ed0ebb80701fe1698407252 Message-Id: <20240202132552.0729E3858033@sourceware.org> Date: Fri, 2 Feb 2024 13:25:51 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f4171ba5e5a772217ed0ebb80701fe1698407252 commit f4171ba5e5a772217ed0ebb80701fe1698407252 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 8d46f2cd4e..7746684160 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 */