Commit 9a3a04ac authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Revert "[PATCH] fix Data Acess error in dup_fd"

This reverts commit 0130b0b3


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 <>
Cc: Sergey Vlasov <>
Cc: Vadim Lobanov <>
Cc: Andrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent dc791d47
......@@ -687,7 +687,6 @@ static struct files_struct *dup_fd(struct files_struct *oldf, int *errorp)
* the latest pointer.
open_files = count_open_files(old_fdt);
old_fdt = files_fdtable(oldf);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment