login
Header Space

 
 

Re: [bug] crash when reading /proc/mounts (was: Re: Linux 2.6.23-rc9 and a heads-up for the 2.6.24 series..)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Ingo Molnar <mingo@...>
Cc: Linux Kernel Mailing List <linux-kernel@...>, Greg KH <gregkh@...>, Alexander Viro <viro@...>, Peter Zijlstra <a.p.zijlstra@...>
Date: Wednesday, October 3, 2007 - 12:07 pm

On Wed, 3 Oct 2007, Ingo Molnar wrote:

I am 100% sure. I can look at the disassembly, and point to the fact that 
your Oops happens on code that is simply totally bogus.

That string is NUL-terminated, which is why the access is to f2a3fffe in 
the first place: we explicitly asked d_path() to create us a string at the 
end of the page (it creates them backwards), so the path string has a NUL 
a the end at address f2a3ffff, which is exactly what we'd expect.

Your compiler really does seem to be total crap.

Do a "make fs/seq_file.s" (and make sure you *disable* CONFIG_DEBUG_INFO 
first, otherwise the result will be unreadable crud), and look at 
seq_path(). It's going to be more readable than the disassembly that I got 
through gdb, but I bet it's going to show it even more clearly.


.. of *course* DEBUG_PAGEALLOC is going to be implied in the problem. If 
you don't have DEBUG_PAGEALLOC, you'll never see this, because you'll have 
all pages mapped, and the only page that it could happen to is the very 
last page in memory, and you'll never hit that one in practice.


It's not about "possible". It's a fact. Send me your "seq_file.s" output 
for that function to be sure - it *could* be memory corruption that 
changes a "movb" into a "movl", and maybe the compiler did a byte move to 
start with, but quite frankly, that is such a remote possibility that I 
don't consider it realistic.


This looks like *exactly* the same thing, except you're in 
"show_vfsmnt()" this time.

Again: the oopsing instruction (8b 3a) is "movl". And again, the address 
is f6206ffe, and it oopses because the (incorrect) 32-bit access will 
touch the next page, so you get a paging request fault on f6207000 - which 
is some *totally* different allocation, and one that isn't mapped because 
it doesn't exist, so DEBUG_PAGE_ALLOC has removed it.

.. and again: exact same thing.


.. and again:


And I can even tell you exactly what path it is:

 - it's going to be the first path that shows up in the path list, since 
   the seq_file interface will re-use that page, so if you hit it, you'll 
   hit it on the first entry (unless seq_file has *lots* of data and needs 
   more than a single-page allocation)

 - it must be a single-byte path, because otheriwse you'd have oopsed one 
   byte earlier (you'd have oopsed already on access .....ffd, which would 
   *also* overflow to the next page

 - ergo, it's "/".

but that doesn't really even matter. Disassembling the code stream from 
your oops shows clearly that it's a 32-bit access. No ifs, buts or maybes 
about it. If you don't trust the gdb disassembly (I didn't, entirely, so I 
looked it up) byte 0x8b is "mov Gv,Ev" in the Intel opcode map.

A 8-bit move would have been 0x8a.

			Linus
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Linux 2.6.23-rc9 and a heads-up for the 2.6.24 series.., Linus Torvalds, (Mon Oct 1, 11:41 pm)
[BUG] Linux 2.6.23-rc9 and MAX_ARG_PAGES, Mathieu Chouquet-Stringer..., (Thu Oct 4, 1:05 pm)
Re: [BUG] Linux 2.6.23-rc9 and MAX_ARG_PAGES, Bill Davidsen, (Sat Oct 6, 1:36 pm)
Re: [BUG] Linux 2.6.23-rc9 and MAX_ARG_PAGES, Hans-Peter Jansen, (Sat Oct 6, 4:29 am)
Re: [BUG] Linux 2.6.23-rc9 and MAX_ARG_PAGES, Hans-Peter Jansen, (Sat Oct 6, 7:29 am)
Re: [BUG] Linux 2.6.23-rc9 and MAX_ARG_PAGES, Chuck Ebbert, (Thu Oct 4, 5:50 pm)
Re: [BUG] Linux 2.6.23-rc9 and MAX_ARG_PAGES, Mathieu Chouquet-Stringer..., (Thu Oct 4, 5:54 pm)
Re: [BUG] Linux 2.6.23-rc9 and MAX_ARG_PAGES, Linus Torvalds, (Thu Oct 4, 1:27 pm)
Re: [BUG] Linux 2.6.23-rc9 and MAX_ARG_PAGES, Mathieu Chouquet-Stringer..., (Thu Oct 4, 4:44 pm)
Re: [BUG] Linux 2.6.23-rc9 and MAX_ARG_PAGES, Linus Torvalds, (Thu Oct 4, 5:21 pm)
Re: [BUG] Linux 2.6.23-rc9 and MAX_ARG_PAGES, Paul Mackerras, (Thu Oct 4, 6:27 pm)
Re: [BUG] Linux 2.6.23-rc9 and MAX_ARG_PAGES, Linus Torvalds, (Thu Oct 4, 8:12 pm)
Re: [BUG] Linux 2.6.23-rc9 and MAX_ARG_PAGES, Mathieu Chouquet-Stringer..., (Thu Oct 4, 11:22 pm)
Re: [BUG] Linux 2.6.23-rc9 and MAX_ARG_PAGES, Peter Zijlstra, (Fri Oct 5, 3:43 am)
Re: [BUG] Linux 2.6.23-rc9 and MAX_ARG_PAGES, Peter Zijlstra, (Thu Oct 4, 1:17 pm)
Re: [BUG] Linux 2.6.23-rc9 and MAX_ARG_PAGES, Mathieu Chouquet-Stringer..., (Thu Oct 4, 5:58 pm)
Re: [BUG] Linux 2.6.23-rc9 and MAX_ARG_PAGES, Mathieu Chouquet-Stringer..., (Thu Oct 4, 4:47 pm)
Re: Linux 2.6.23-rc9 and a heads-up for the 2.6.24 series.., Rafael J. Wysocki, (Tue Oct 2, 4:12 pm)
Re: Linux 2.6.23-rc9 and a heads-up for the 2.6.24 series.., Rafael J. Wysocki, (Tue Oct 2, 4:31 pm)
Re: Linux 2.6.23-rc9 and a heads-up for the 2.6.24 series.., Thomas Gleixner, (Tue Oct 2, 11:30 am)
Re: Linux 2.6.23-rc9 and a heads-up for the 2.6.24 series.., Eric St-Laurent, (Tue Oct 2, 11:53 pm)
[patch] net, 9p: build fix with !CONFIG_SYSCTL, Ingo Molnar, (Thu Oct 4, 7:55 am)
Re: [bug] crash when reading /proc/mounts (was: Re: Linux 2...., Linus Torvalds, (Wed Oct 3, 12:07 pm)
Re: Linux 2.6.23-rc9 and a heads-up for the 2.6.24 series.., Alistair John Strachan, (Tue Oct 2, 6:51 pm)
Re: Linux 2.6.23-rc9 and a heads-up for the 2.6.24 series.., Alistair John Strachan, (Sun Oct 7, 7:44 pm)
Re: Linux 2.6.23-rc9 and a heads-up for the 2.6.24 series.., Glauber de Oliveira Costa..., (Tue Oct 2, 7:00 pm)
speck-geostationary