summaryrefslogtreecommitdiffstats
path: root/libc/arch-arm
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2013-09-10 16:56:34 -0700
committerChristopher Ferris <cferris@google.com>2013-09-20 20:12:09 -0700
commit16e185c9081530859c17270fbaf5798f0ea871f8 (patch)
tree610f608fea65670da8650a1d93585321972526db /libc/arch-arm
parentad999b6062909d4922fb360a6f3b7f412cc06111 (diff)
downloadbionic-16e185c9081530859c17270fbaf5798f0ea871f8.zip
bionic-16e185c9081530859c17270fbaf5798f0ea871f8.tar.gz
bionic-16e185c9081530859c17270fbaf5798f0ea871f8.tar.bz2
__memcpy_chk: Fix signed cmp of unsigned values.
I accidentally did a signed comparison of the size_t values passed in for three of the _chk functions. Changing them to unsigned compares. Add three new tests to verify this failure is fixed. Bug: 10691831 Merge from internal master. (cherry-picked from 883ef2499c2ff76605f73b1240f719ca6282e554) Change-Id: Id9a96b549435f5d9b61dc132cf1082e0e30889f5
Diffstat (limited to 'libc/arch-arm')
-rw-r--r--libc/arch-arm/cortex-a15/bionic/__strcat_chk.S2
-rw-r--r--libc/arch-arm/cortex-a15/bionic/__strcpy_chk.S2
-rw-r--r--libc/arch-arm/cortex-a15/bionic/memcpy.S2
-rw-r--r--libc/arch-arm/cortex-a9/bionic/__strcat_chk.S2
-rw-r--r--libc/arch-arm/cortex-a9/bionic/__strcpy_chk.S2
-rw-r--r--libc/arch-arm/cortex-a9/bionic/memcpy.S2
-rw-r--r--libc/arch-arm/krait/bionic/__strcat_chk.S2
-rw-r--r--libc/arch-arm/krait/bionic/__strcpy_chk.S2
-rw-r--r--libc/arch-arm/krait/bionic/memcpy.S2
9 files changed, 9 insertions, 9 deletions
diff --git a/libc/arch-arm/cortex-a15/bionic/__strcat_chk.S b/libc/arch-arm/cortex-a15/bionic/__strcat_chk.S
index 4693600..4aaa9f1 100644
--- a/libc/arch-arm/cortex-a15/bionic/__strcat_chk.S
+++ b/libc/arch-arm/cortex-a15/bionic/__strcat_chk.S
@@ -180,7 +180,7 @@ ENTRY(__strcat_chk)
.L_strlen_done:
add r2, r3, r4
cmp r2, lr
- bgt __strcat_chk_failed
+ bhi __strcat_chk_failed
// Set up the registers for the memcpy code.
mov r1, r5
diff --git a/libc/arch-arm/cortex-a15/bionic/__strcpy_chk.S b/libc/arch-arm/cortex-a15/bionic/__strcpy_chk.S
index 1224b49..05152e6 100644
--- a/libc/arch-arm/cortex-a15/bionic/__strcpy_chk.S
+++ b/libc/arch-arm/cortex-a15/bionic/__strcpy_chk.S
@@ -151,7 +151,7 @@ ENTRY(__strcpy_chk)
pld [r1, #64]
ldr r0, [sp]
cmp r3, lr
- bge __strcpy_chk_failed
+ bhs __strcpy_chk_failed
// Add 1 for copy length to get the string terminator.
add r2, r3, #1
diff --git a/libc/arch-arm/cortex-a15/bionic/memcpy.S b/libc/arch-arm/cortex-a15/bionic/memcpy.S
index a300e43..a843230 100644
--- a/libc/arch-arm/cortex-a15/bionic/memcpy.S
+++ b/libc/arch-arm/cortex-a15/bionic/memcpy.S
@@ -65,7 +65,7 @@
ENTRY(__memcpy_chk)
.cfi_startproc
cmp r2, r3
- bgt __memcpy_chk_fail
+ bhi __memcpy_chk_fail
// Fall through to memcpy...
.cfi_endproc
diff --git a/libc/arch-arm/cortex-a9/bionic/__strcat_chk.S b/libc/arch-arm/cortex-a9/bionic/__strcat_chk.S
index cc43456..78cf19a 100644
--- a/libc/arch-arm/cortex-a9/bionic/__strcat_chk.S
+++ b/libc/arch-arm/cortex-a9/bionic/__strcat_chk.S
@@ -183,7 +183,7 @@ ENTRY(__strcat_chk)
.L_strlen_done:
add r2, r3, r4
cmp r2, lr
- bgt __strcat_chk_fail
+ bhi __strcat_chk_fail
// Set up the registers for the memcpy code.
mov r1, r5
diff --git a/libc/arch-arm/cortex-a9/bionic/__strcpy_chk.S b/libc/arch-arm/cortex-a9/bionic/__strcpy_chk.S
index dd3370b..d0acf1e 100644
--- a/libc/arch-arm/cortex-a9/bionic/__strcpy_chk.S
+++ b/libc/arch-arm/cortex-a9/bionic/__strcpy_chk.S
@@ -153,7 +153,7 @@ ENTRY(__strcpy_chk)
pld [r1, #64]
ldr r0, [sp]
cmp r3, lr
- bge __strcpy_chk_fail
+ bhs __strcpy_chk_fail
// Add 1 for copy length to get the string terminator.
add r2, r3, #1
diff --git a/libc/arch-arm/cortex-a9/bionic/memcpy.S b/libc/arch-arm/cortex-a9/bionic/memcpy.S
index 21e0ebe..5c4c428 100644
--- a/libc/arch-arm/cortex-a9/bionic/memcpy.S
+++ b/libc/arch-arm/cortex-a9/bionic/memcpy.S
@@ -43,7 +43,7 @@
ENTRY(__memcpy_chk)
.cfi_startproc
cmp r2, r3
- bgt __memcpy_chk_fail
+ bhi __memcpy_chk_fail
// Fall through to memcpy...
.cfi_endproc
diff --git a/libc/arch-arm/krait/bionic/__strcat_chk.S b/libc/arch-arm/krait/bionic/__strcat_chk.S
index ec99077..956b461 100644
--- a/libc/arch-arm/krait/bionic/__strcat_chk.S
+++ b/libc/arch-arm/krait/bionic/__strcat_chk.S
@@ -180,7 +180,7 @@ ENTRY(__strcat_chk)
.L_strlen_done:
add r2, r3, r4
cmp r2, lr
- bgt __strcat_chk_failed
+ bhi __strcat_chk_failed
// Set up the registers for the memcpy code.
mov r1, r5
diff --git a/libc/arch-arm/krait/bionic/__strcpy_chk.S b/libc/arch-arm/krait/bionic/__strcpy_chk.S
index 7da4d15..402cac6 100644
--- a/libc/arch-arm/krait/bionic/__strcpy_chk.S
+++ b/libc/arch-arm/krait/bionic/__strcpy_chk.S
@@ -151,7 +151,7 @@ ENTRY(__strcpy_chk)
pld [r1, #64]
ldr r0, [sp]
cmp r3, lr
- bge __strcpy_chk_failed
+ bhs __strcpy_chk_failed
// Add 1 for copy length to get the string terminator.
add r2, r3, #1
diff --git a/libc/arch-arm/krait/bionic/memcpy.S b/libc/arch-arm/krait/bionic/memcpy.S
index e433402..ea040bc 100644
--- a/libc/arch-arm/krait/bionic/memcpy.S
+++ b/libc/arch-arm/krait/bionic/memcpy.S
@@ -46,7 +46,7 @@
ENTRY(__memcpy_chk)
.cfi_startproc
cmp r2, r3
- bgt __memcpy_chk_fail
+ bhi __memcpy_chk_fail
// Fall through to memcpy...
.cfi_endproc