Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9e25ae6d91e7fb058c8957c2a64dc3ca0377dd5b
Commit:     9e25ae6d91e7fb058c8957c2a64dc3ca0377dd5b
Parent:     7af1443a9d319132087e1e9a3984b94c6998835c
Author:     Michael Ellerman <[EMAIL PROTECTED]>
AuthorDate: Wed Sep 19 14:38:12 2007 +1000
Committer:  Paul Mackerras <[EMAIL PROTECTED]>
CommitDate: Wed Sep 19 15:12:19 2007 +1000

    [POWERPC] spufs: Respect RLIMIT_CORE in spu coredump code
    
    Currently the spu coredump code doesn't respect the ulimit, it should.
    
    Signed-off-by: Michael Ellerman <[EMAIL PROTECTED]>
    Signed-off-by: Jeremy Kerr <[EMAIL PROTECTED]>
    Signed-off-by: Paul Mackerras <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/cell/spufs/coredump.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/cell/spufs/coredump.c 
b/arch/powerpc/platforms/cell/spufs/coredump.c
index 6b8aef6..80f6236 100644
--- a/arch/powerpc/platforms/cell/spufs/coredump.c
+++ b/arch/powerpc/platforms/cell/spufs/coredump.c
@@ -53,8 +53,12 @@ static ssize_t do_coredump_read(int num, struct spu_context 
*ctx, void *buffer,
  */
 static int spufs_dump_write(struct file *file, const void *addr, int nr, 
loff_t *foffset)
 {
+       unsigned long limit = current->signal->rlim[RLIMIT_CORE].rlim_cur;
        ssize_t written;
 
+       if (*foffset + nr > limit)
+               return -EIO;
+
        written = file->f_op->write(file, addr, nr, &file->f_pos);
        *foffset += written;
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to