mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-27 03:41:23 +08:00
arm: Remove wrong ldr from _dl_start_user (BZ 31339)
The commit49d877a80b
(arm: Remove _dl_skip_args usage) removed the _SKIP_ARGS literal, which was previously loader to r4 on loader _start. However, the cleanup did not remove the following 'ldr r4, [sl, r4]' on _dl_start_user, used to check to skip the arguments after ld self-relocations. In my testing, the kernel initially set r4 to 0, which makes the ldr instruction just read the _GLOBAL_OFFSET_TABLE_. However, since r4 is a callee-saved register; a different runtime might not zero initialize it and thus trigger an invalid memory access. Checked on arm-linux-gnu. Reported-by: Adrian Ratiu <adrian.ratiu@collabora.com> Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com> (cherry picked from commit1e25112dc0
)
This commit is contained in:
parent
6d1e3fb07b
commit
63295e4fda
@ -139,7 +139,6 @@ _start:\n\
|
|||||||
_dl_start_user:\n\
|
_dl_start_user:\n\
|
||||||
adr r6, .L_GET_GOT\n\
|
adr r6, .L_GET_GOT\n\
|
||||||
add sl, sl, r6\n\
|
add sl, sl, r6\n\
|
||||||
ldr r4, [sl, r4]\n\
|
|
||||||
@ save the entry point in another register\n\
|
@ save the entry point in another register\n\
|
||||||
mov r6, r0\n\
|
mov r6, r0\n\
|
||||||
@ get the original arg count\n\
|
@ get the original arg count\n\
|
||||||
|
Loading…
Reference in New Issue
Block a user