diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-06-16 00:53:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-06-16 00:53:52 -0400 |
commit | 13fca640bb8ab611a50e0ba120b186faa2994d6c (patch) | |
tree | 0a40a28e498b2e9abdef8c86aa0aef7f82096f00 /fs/exec.c | |
parent | 67de0162fbb78713fcb23cb2502b380faa8bde73 (diff) |
Revert "fs/exec.c: use BUILD_BUG_ON for VM_STACK_FLAGS & VM_STACK_INCOMPLETE_SETUP"
This reverts commit 7f81c8890c15a10f5220bebae3b6dfae4961962a.
It turns out that it's not actually a build-time check on x86-64 UML,
which does some seriously crazy stuff with VM_STACK_FLAGS.
The VM_STACK_FLAGS define depends on the arch-supplied
VM_STACK_DEFAULT_FLAGS value, and on x86-64 UML we have
arch/um/sys-x86_64/shared/sysdep/vm-flags.h:
#define VM_STACK_DEFAULT_FLAGS \
(test_thread_flag(TIF_IA32) ? vm_stack_flags32 : vm_stack_flags)
#define VM_STACK_DEFAULT_FLAGS vm_stack_flags
(yes, seriously: two different #define's for that thing, with the first
one being inside an "#ifdef TIF_IA32")
It's possible that it is UML that should just be fixed in this area, but
for now let's just undo the (very small) optimization.
Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Richard Weinberger <richard@nod.at>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/exec.c')
-rw-r--r-- | fs/exec.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -277,7 +277,7 @@ static int __bprm_mm_init(struct linux_binprm *bprm) | |||
277 | * use STACK_TOP because that can depend on attributes which aren't | 277 | * use STACK_TOP because that can depend on attributes which aren't |
278 | * configured yet. | 278 | * configured yet. |
279 | */ | 279 | */ |
280 | BUILD_BUG_ON(VM_STACK_FLAGS & VM_STACK_INCOMPLETE_SETUP); | 280 | BUG_ON(VM_STACK_FLAGS & VM_STACK_INCOMPLETE_SETUP); |
281 | vma->vm_end = STACK_TOP_MAX; | 281 | vma->vm_end = STACK_TOP_MAX; |
282 | vma->vm_start = vma->vm_end - PAGE_SIZE; | 282 | vma->vm_start = vma->vm_end - PAGE_SIZE; |
283 | vma->vm_flags = VM_STACK_FLAGS | VM_STACK_INCOMPLETE_SETUP; | 283 | vma->vm_flags = VM_STACK_FLAGS | VM_STACK_INCOMPLETE_SETUP; |