Re: [PATCH 0/1][BUG][IMPORTANT] KEYRINGS: find_keyring_by_name() can gain the freed keyring

From: David Howells
Date: Fri Apr 23 2010 - 04:39:23 EST


Toshiyuki Okajima <toshi.okajima@xxxxxxxxxxxxxx> wrote:

> #!/bin/sh
>
> LOOP=100000
> USER=dummy_user
> # add
> /bin/su -c "exit;" $USER || { /usr/sbin/adduser -m $USER; add=1; }
>
> for ((i=0; i<LOOP; i++))
> do
> /bin/su -c "echo '$i' > /dev/null" $USER
> done
>
> # del
> (( add == 1 )) && /usr/sbin/userdel -r $USER
> exit

Doing:

for ((i=0; i<100000; i++)); do keyctl session wibble /bin/true || break; done

ought to work too.

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/