2.6.0-mm1 - kernel panic (VFS bug?)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 6 lines · Libor Vanek
...
asmlinkage longsys_open(const char __user * filename, int flags, int mode){ char * tmp; int fd, error; char tmp_path[PATH_MAX],tmp2_path[PATH_MAX];
PATH_MAX is 4096. The i386 stack is only 6k. You already overflowed it. You're lucky if your machine only panics, much worse things can happen with kernel stack overflows.
-Andi
Quoted 11 lines · Andi Kleen
Quoted 8 lines · Libor Vanek
...
asmlinkage longsys_open(const char __user * filename, int flags, int mode){ char * tmp; int fd, error; char tmp_path[PATH_MAX],tmp2_path[PATH_MAX];
Quoted 5 lines
PATH_MAXis 4096. The i386 stack is only 6k. You already overflowed it. You're lucky if your machine only panics, much worse things can happen with kernel stack overflows.
OK - what's correct implementation? Do a "char * tmp_path" and kmalloc it?
Signature · 1 line
Libor Vanek
Quoted 1 line
OK - what's correct implementation? Do a "char *
tmp_path" and kmalloc it?
Use getname()/putname()
-Andi
Quoted 6 lines · Andi Kleen
Quoted 3 lines
OK - what's correct implementation? Do a "char *
tmp_path" and kmalloc it?Use getname()/putname()
I thought that these are used for copying data to/from userspace...
Signature · 1 line
Libor Vanek
Quoted 6 lines · Libor Vanek
Quoted 3 lines
PATH_MAXis 4096. The i386 stack is only 6k. You already overflowed it. You're lucky if your machine only panics, much worse things can happen with kernel stack overflows.OK - what's correct implementation? Do a "char *
tmp_path" and kmalloc it?
Generally speaking, yes. That way you get reentrancy for free and don't use up too much kernel stack. If speed is of the utmost importance, there are other possible solutions.
Cheers,
Muli
Signature · 4 lines
Muli Ben-Yehuda http://www.mulix.org | http://mulix.livejournal.com/ "the nucleus of linux oscillates my world" - gccbot@#offtopic