diff options
author | Kirill Korotaev <dev@openvz.org> | 2006-03-31 08:58:46 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-31 15:25:46 -0500 |
commit | 428622986858aebddc32d022af65e88b9d2ea8bb (patch) | |
tree | 888b968f53e55d81386836ae3f43f46cea4ad6ce /kernel | |
parent | e358c1a2c45f7ec32d77cc09a2bb42d6823a4193 (diff) |
[PATCH] wrong error path in dup_fd() leading to oopses in RCU
Wrong error path in dup_fd() - it should return NULL on error,
not an address of already freed memory :/
Triggered by OpenVZ stress test suite.
What is interesting is that it was causing different oopses in RCU like
below:
Call Trace:
[<c013492c>] rcu_do_batch+0x2c/0x80
[<c0134bdd>] rcu_process_callbacks+0x3d/0x70
[<c0126cf3>] tasklet_action+0x73/0xe0
[<c01269aa>] __do_softirq+0x10a/0x130
[<c01058ff>] do_softirq+0x4f/0x60
=======================
[<c0113817>] smp_apic_timer_interrupt+0x77/0x110
[<c0103b54>] apic_timer_interrupt+0x1c/0x24
Code: Bad EIP value.
<0>Kernel panic - not syncing: Fatal exception in interrupt
Signed-Off-By: Pavel Emelianov <xemul@sw.ru>
Signed-Off-By: Dmitry Mishin <dim@openvz.org>
Signed-Off-By: Kirill Korotaev <dev@openvz.org>
Signed-Off-By: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/fork.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index 03975d0467f9..3384eb89cb1c 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -725,7 +725,7 @@ out_release: | |||
725 | free_fdset (new_fdt->open_fds, new_fdt->max_fdset); | 725 | free_fdset (new_fdt->open_fds, new_fdt->max_fdset); |
726 | free_fd_array(new_fdt->fd, new_fdt->max_fds); | 726 | free_fd_array(new_fdt->fd, new_fdt->max_fds); |
727 | kmem_cache_free(files_cachep, newf); | 727 | kmem_cache_free(files_cachep, newf); |
728 | goto out; | 728 | return NULL; |
729 | } | 729 | } |
730 | 730 | ||
731 | static int copy_files(unsigned long clone_flags, struct task_struct * tsk) | 731 | static int copy_files(unsigned long clone_flags, struct task_struct * tsk) |