Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.4.1 /fs/exec.c

Filename:/fs/exec.c
Lines Added:6
Lines Deleted:3
Also changed in: (Previous) 2.4.1-pre12  2.4.1-pre11  2.4.1-pre10  2.4.1-pre9  2.4.1-pre8  2.4.1-pre6 
(Following) 2.4.1-ac1  2.4.1-ac2  2.4.1-ac3  2.4.1-ac4  2.4.1-ac5  2.4.1-ac6 

Location
[  2.4.1
  [  fs
     o  exec.c

Patch

diff -u --recursive --new-file v2.4.0/linux/fs/exec.c linux/fs/exec.c
--- v2.4.0/linux/fs/exec.c   Wed Jan  3 20:45:26 2001
+++ linux/fs/exec.c   Mon Jan 29 23:10:58 2001
@@ -388,10 +388,8 @@
 
    old_mm = current->mm;
    if (old_mm && atomic_read(&old_mm->mm_users) == 1) {
-      flush_cache_mm(old_mm);
       mm_release();
       exit_mmap(old_mm);
-      flush_tlb_mm(old_mm);
       return 0;
    }
 
@@ -407,6 +405,7 @@
       /* Add it to the list of mm's */
       spin_lock(&mmlist_lock);
       list_add(&mm->mmlist, &init_mm.mmlist);
+      mmlist_nr++;
       spin_unlock(&mmlist_lock);
 
       task_lock(current);
@@ -938,18 +937,22 @@
 #else
    corename[4] = '\0';
 #endif
-   file = filp_open(corename, O_CREAT | 2 | O_TRUNC | O_NOFOLLOW, 0600);
+   file = filp_open(corename, O_CREAT | 2 | O_NOFOLLOW, 0600);
    if (IS_ERR(file))
       goto fail;
    inode = file->f_dentry->d_inode;
    if (inode->i_nlink > 1)
       goto close_fail;   /* multiple links - don't dump */
+   if (d_unhashed(file->f_dentry))
+      goto close_fail;
 
    if (!S_ISREG(inode->i_mode))
       goto close_fail;
    if (!file->f_op)
       goto close_fail;
    if (!file->f_op->write)
+      goto close_fail;
+   if (do_truncate(file->f_dentry, 0) != 0)
       goto close_fail;
    if (!binfmt->core_dump(signr, regs, file))
       goto close_fail;


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.