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

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

Advertisement

Kernel v2.6.24-rc5 /fs/binfmt_aout.c

Filename:/fs/binfmt_aout.c
Lines Added:6
Lines Deleted:10
Also changed in: (Previous) 2.6.24-rc4  2.6.24-rc3  2.6.24-rc2  2.6.24-rc1  2.6.23-git19  2.6.23-git18 
(Following) 2.6.24-rc6  2.6.24-rc7  2.6.24-rc8  2.6.24  2.6.24-git17  2.6.24-git18 

Location
[  2.6.24-rc5
  [  fs
     o  binfmt_aout.c

Patch

diff --git a/fs/binfmt_aout.c b/fs/binfmt_aout.c
index 813a887..e176d19 100644
--- a/fs/binfmt_aout.c
+++ b/fs/binfmt_aout.c
@@ -31,7 +31,7 @@
 
 static int load_aout_binary(struct linux_binprm *, struct pt_regs * regs);
 static int load_aout_library(struct file*);
-static int aout_core_dump(long signr, struct pt_regs * regs, struct file *file);
+static int aout_core_dump(long signr, struct pt_regs *regs, struct file *file, unsigned long limit);
 
 static struct linux_binfmt aout_format = {
    .module      = THIS_MODULE,
@@ -88,7 +88,7 @@ if (file->f_op->llseek) { \
  * dumping of the process results in another error..
  */
 
-static int aout_core_dump(long signr, struct pt_regs * regs, struct file *file)
+static int aout_core_dump(long signr, struct pt_regs *regs, struct file *file, unsigned long limit)
 {
    mm_segment_t fs;
    int has_dumped = 0;
@@ -123,23 +123,19 @@ static int aout_core_dump(long signr, struct pt_regs * regs, struct file *file)
 /* If the size of the dump file exceeds the rlimit, then see what would happen
    if we wrote the stack, but not the data area.  */
 #ifdef __sparc__
-   if ((dump.u_dsize+dump.u_ssize) >
-       current->signal->rlim[RLIMIT_CORE].rlim_cur)
+   if ((dump.u_dsize + dump.u_ssize) > limit)
       dump.u_dsize = 0;
 #else
-   if ((dump.u_dsize+dump.u_ssize+1) * PAGE_SIZE >
-       current->signal->rlim[RLIMIT_CORE].rlim_cur)
+   if ((dump.u_dsize + dump.u_ssize+1) * PAGE_SIZE > limit)
       dump.u_dsize = 0;
 #endif
 
 /* Make sure we have enough room to write the stack and data areas. */
 #ifdef __sparc__
-   if ((dump.u_ssize) >
-       current->signal->rlim[RLIMIT_CORE].rlim_cur)
+   if (dump.u_ssize > limit)
       dump.u_ssize = 0;
 #else
-   if ((dump.u_ssize+1) * PAGE_SIZE >
-       current->signal->rlim[RLIMIT_CORE].rlim_cur)
+   if ((dump.u_ssize + 1) * PAGE_SIZE > limit)
       dump.u_ssize = 0;
 #endif
 


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