random pid causing file i/o problems

Discuss usability issues, general maintenance, and general support issues for a grsecurity-enabled system.

random pid causing file i/o problems

Postby gossamer23 » Mon Sep 27, 2004 3:28 pm

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
gossamer23
 
Posts: 2
Joined: Mon Sep 27, 2004 3:19 pm

Postby spender » Tue Sep 28, 2004 6:38 pm

Can you mail your kernel config to spender@grsecurity.net?

-Brad
spender
 
Posts: 2185
Joined: Wed Feb 20, 2002 8:00 pm

Postby gossamer23 » Tue Oct 05, 2004 12:11 pm

spender wrote:Can you mail your kernel config to spender@grsecurity.net?


Done! Thanks!

Alex
gossamer23
 
Posts: 2
Joined: Mon Sep 27, 2004 3:19 pm


Return to grsecurity support