ls -l segfault + [PATCH]

Jan Evert van Grootheest Jan-Evert.van.Grootheest at Vialis.nl
Mon Mar 19 11:03:07 UTC 2007


> On Mon, Mar 19, 2007 at 08:26:46AM +0100, Jan Evert van 
> Grootheest wrote:
> > Hmm, it crashes for me also with ls -la /bin...
> > And it doesn't crash in strace (or gdb) here too.
> 
> Busybox has a feature that allows calling applet_main() 
> instead of exec(self, applet, args...). It might be that 
> there's some changed data that causes the SEGV.
> 
> Change the function is_safe_applet, in shell/ash.c, to always 
> return false (0), and check if the SEGV disappears.

And ls is one of those safe applets. Hmm. There's no SEGV if it is done as /bin/ls -l /bin.
I will try this. I guess that with return 0, ls will behave as /bin/ls.
I tried to figure out the code in tryexec. Can anyone explain how this will not exit the shell for a safe applet? Or does that exit(a->main()) something different than explained in man 3 exit?

Another funny thing is that ls -lF /bin does not crash!

Does that explain why adding LS_COLORS to the environment is not visible in the ls output?

-- Jan Evert 
 
The information contained in this communication is confidential and may be legally privileged. It is intended solely for the use of the individual or entity to whom it is addressed and others authorised to receive it. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution or taking any action in reliance on the contents of this information is strictly prohibited and may be unlawful. Vialis is neither liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt. 
 



More information about the busybox mailing list