[Bug 4496] passwd applet ruins UID field in /etc/passwd

bugzilla at busybox.net bugzilla at busybox.net
Tue Nov 22 13:55:25 UTC 2011


https://bugs.busybox.net/show_bug.cgi?id=4496

--- Comment #9 from Jelle Martijn Kok <jmkok at youcom.nl> 2011-11-22 13:55:24 UTC ---
Hi Denys,

> Which libc do you use?
I'm using glibc 2.13 (included in Sourcery G++ Lite 2011.03-41)

> You might want to step into strstr call under gdb

Did a quick-course on gdb and arm assembly...

Started gdb and gdb-server:
- I ran the code until strstr(filename, "shadow")
- I then requested some (register) states
(gdb) x/i $pc
=> 0x90c1c <update_passwd+12>:    bl    0xc860 <strstr>
(gdb) x/s $r0
0x9e21b:     "/etc/shadow"
(gdb) x/s $r1
0x9e220:     "shadow"

I noticed that R1 (the needle) overlaps R0 (the haystack). Could this cause the
problem. I guess this might be the result of the Os flag. However it seems that
this is allowed... (I could only find that memcpy is not allowed to overlap).

perform stepi in strstr() seems to be a bit tough, I'll give it another go...

> Can you disassemble busybox (objdump -dr busybox) and post here the fragment
which shows strstr function's assembly code?

I use dynamic libraries so I guess you want to have the dump from
"libc-2.13.so"
I performed: objdump -dr lib/libc-2.13.so | grep '<strstr>:' -A 350
libc-2.13.so.s > strstr.s

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the busybox-cvs mailing list