]> git.baikalelectronics.ru Git - kernel.git/commit
fix NULL pointer dereference in __vm_enough_memory()
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Wed, 22 Aug 2007 21:01:28 +0000 (14:01 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 23 Aug 2007 02:52:45 +0000 (19:52 -0700)
commit9e0454ad8005504d3541333767c6bb27d4d0a079
tree91d620288f1aaf63c12dc84ca1015465818601f2
parent0e8622ebc66791adeebf25fafc283bb0d9e4ef30
fix NULL pointer dereference in __vm_enough_memory()

The new exec code inserts an accounted vma into an mm struct which is not
current->mm.  The existing memory check code has a hard coded assumption
that this does not happen as does the security code.

As the correct mm is known we pass the mm to the security method and the
helper function.  A new security test is added for the case where we need
to pass the mm and the existing one is modified to pass current->mm to
avoid the need to change large amounts of code.

(Thanks to Tobias for fixing rejects and testing)

Signed-off-by: Alan Cox <alan@redhat.com>
Cc: WU Fengguang <wfg@mail.ustc.edu.cn>
Cc: James Morris <jmorris@redhat.com>
Cc: Tobias Diedrich <ranma+kernel@tdiedrich.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/mm.h
include/linux/security.h
mm/mmap.c
mm/nommu.c
security/commoncap.c
security/dummy.c
security/selinux/hooks.c