Page 1 of 1

random pid causing file i/o problems

PostPosted: Mon Sep 27, 2004 3:28 pm
by gossamer23
Hi,

We are seeing a very rare race problem that is only showing up with random pid turned on. This is with stock 2.6.7 and 2.4.26 and grsec 2.0.1.

If you try the following bash script:

Code: Select all
#!/bin/bash

i=0
die() {
    echo -e "\n$i: $@" >&2
    exit 1
}

while :; do
    (( i++ ))
    mv file file.old || die "mv failed"
    if [ ! -f file.old ]; then
        die "copy of file -> file.old failed, wtf??"
    fi
    if [ -f file ]; then
        die "remove of file failed, wtf??"
    fi
    mv file.old file || die "mv2 failed"
    if [ ! -f file ]; then
        die "copy of file.old -> file failed, wtf??"
    fi
    if [ -f file.old ]; then
        die "remove of file.old failed, wtf??"
    fi
done


will fail randomly. If you run this from within a tmpfs partition it fails usually in under a minute. On a normal partition, it fails in 30 minutes or so.

Can anyone else replicate this, or have any ideas on what's going on? If we turn off random pids, we can't replicate this problem.

Cheers,

Alex

PostPosted: Tue Sep 28, 2004 6:38 pm
by spender
Can you mail your kernel config to spender@grsecurity.net?

-Brad

PostPosted: Tue Oct 05, 2004 12:11 pm
by gossamer23
spender wrote:Can you mail your kernel config to spender@grsecurity.net?


Done! Thanks!

Alex