]> git.baikalelectronics.ru Git - kernel.git/commit
mm: WARN_ON_ONCE if f_op->mmap() change vma's start address
authorJoonsoo Kim <js1304@gmail.com>
Wed, 12 Dec 2012 21:51:53 +0000 (13:51 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 13 Dec 2012 01:38:33 +0000 (17:38 -0800)
commit6b52d8c4dce1146cc3ea6d5c2d7358bf75d1cc1d
tree0b6efa9f80c4115949cc3d26eaddfd3e7031bbae
parentf699e1f23d03fcb81ecd98ccd6a5e196fffbd2ff
mm: WARN_ON_ONCE if f_op->mmap() change vma's start address

During reviewing the source code, I found a comment which mention that
after f_op->mmap(), vma's start address can be changed.  I didn't verify
that it is really possible, because there are so many f_op->mmap()
implementation.  But if there are some mmap() which change vma's start
address, it is possible error situation, because we already prepare prev
vma, rb_link and rb_parent and these are related to original address.

So add WARN_ON_ONCE for finding that this situtation really happens.

Signed-off-by: Joonsoo Kim <js1304@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/mmap.c