Skip to content

Commit

Permalink
ARM: Fix clone code when built for Thumb.
Browse files Browse the repository at this point in the history
The mov lr, pc instruction will lose the Thumb bit from the return address
so use blx lr instead.

ports/ChangeLog.arm:

2013-08-30  Will Newton  <will.newton@linaro.org>

	[BZ #15909]
	* sysdeps/unix/sysv/linux/arm/clone.S (__clone): Use blx
	instead of mov lr, pc.
  • Loading branch information
Will Newton committed Aug 30, 2013
1 parent 2601bc1 commit 6b06ac5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Version 2.19
* The following bugs are resolved with this release:

14699, 15522, 15531, 15532, 15736, 15749, 15797, 15867, 15890, 15897,
15905.
15905, 15909.

* CVE-2013-4237 The readdir_r function could write more than NAME_MAX bytes
to the d_name member of struct dirent, or omit the terminating NUL
Expand Down
6 changes: 6 additions & 0 deletions ports/ChangeLog.arm
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2013-08-30 Will Newton <will.newton@linaro.org>

[BZ #15909]
* sysdeps/unix/sysv/linux/arm/clone.S (__clone): Use blx
instead of mov lr, pc.

2013-08-30 Will Newton <will.newton@linaro.org>

* sysdeps/arm/armv6t2/strlen.S: New file.
Expand Down
4 changes: 2 additions & 2 deletions ports/sysdeps/unix/sysv/linux/arm/clone.S
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ PSEUDO_END (__clone)
mov lr, pc
bx ip
#else
mov lr, pc
ldr pc, [sp], #8
ldr lr, [sp], #8
blx lr
#endif

@ and we are done, passing the return value through r0
Expand Down

0 comments on commit 6b06ac5

Please sign in to comment.