[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Kernel stack for a process



Nagaraj wrote:
> 
> > No, you could not crash the kernel this way. Your
> > userland program would be the one traversing the symlinks,
> > in -user space-. Each call into the kernel would
> > traverse one link, sure, but that's certainly not
> > going to be a problem for the kernel.
> >
> 
> plz have a look at:
> http://lwn.net/Articles/2995/
> 
> I think user process can still do it.

Er... no, the article you cite says the same thing I said:
the kernel limits symlink traversals on any given path.
Any attempt by a user to exploit the recursive nature
of symlink lookups will simply fail, without damaging
the kernel in any way.
 
> > I also suspect (though I do not know this for certain)
> > that the kernel is smart enough to detect kernel-stack
> > overflow and kill the offending process. It would be
> > trivial: just keep a read-only PTE at the end of the
> > kernel stack, and if anything tries to write
> > there, take a page fault, notice that it's adjacent
> > to the task stack, and kill the process.
> 
> http://van-dijk.net/linuxkernel/200206/1235.html
> By reading that, i think it wont ! ( i may be wrong here )
> I donno abt latest kernels.

That article doesn't seem to address this issue. It
describes a patch for configurable stack size, but does
not say anything about the means by which the kernel
handles (or fails to handle) a stack overflow.

If I get a chance, I'll look at the 2.5.33 code tomorrow
and see if it does anything smart in that case.

-- Joe
  "I'd rather chew my leg off than maintain Java code, which
   sucks, 'cause I have a lot of Java code to maintain and
   the leg surgery is starting to get expensive." - Me
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/