aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.osdl.org>2006-11-14 18:20:51 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-11-14 18:20:51 -0500
commit9a3a04ac386f44175b6a4142eaeab3d4170a57f3 (patch)
treeb07590ec50da7d079b1c2852ccc79cbcd8fb2cce /kernel/fork.c
parentdc791d479802a784836a236d4a77a5325be545c4 (diff)
Revert "[PATCH] fix Data Acess error in dup_fd"
This reverts commit 0130b0b32ee53dc7add773fcea984f6a26ef1da3. Sergey Vlasov points out (and Vadim Lobanov concurs) that the bug it was supposed to fix must be some unrelated memory corruption, and the "fix" actually causes more problems: "However, the new code does not look safe in all cases. If some other task has opened more files while dup_fd() released oldf->file_lock, the new code will update open_files to the new larger value. But newf was allocated with the old smaller value of open_files, therefore subsequent accesses to newf may try to write into unallocated memory." so revert it. Cc: Sharyathi Nagesh <sharyath@in.ibm.com> Cc: Sergey Vlasov <vsu@altlinux.ru> Cc: Vadim Lobanov <vlobanov@speakeasy.net> Cc: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 4b4eab2a3161..3da978eec791 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -687,7 +687,6 @@ static struct files_struct *dup_fd(struct files_struct *oldf, int *errorp)
687 * the latest pointer. 687 * the latest pointer.
688 */ 688 */
689 spin_lock(&oldf->file_lock); 689 spin_lock(&oldf->file_lock);
690 open_files = count_open_files(old_fdt);
691 old_fdt = files_fdtable(oldf); 690 old_fdt = files_fdtable(oldf);
692 } 691 }
693 692