]>
git.proxmox.com Git - ceph.git/blob - ceph/qa/workunits/rbd/huge-tickets.sh
3 # This is a test for http://tracker.ceph.com/issues/8979 and the fallout
4 # from triaging it. #8979 itself was random crashes on corrupted memory
5 # due to a buffer overflow (for tickets larger than 256 bytes), further
6 # inspection showed that vmalloced tickets weren't handled correctly as
9 # What we are doing here is generating three huge keyrings and feeding
10 # them to libceph (through 'rbd map' on a scratch image). Bad kernels
11 # will crash reliably either on corrupted memory somewhere or a bad page
12 # fault in scatterwalk_pagedone().
16 function generate_keyring
() {
20 ceph-authtool
-C -n client.
$user --cap mon
'allow *' --gen-key /tmp
/keyring-
$user
22 set +x
# don't pollute trace with echos
23 echo -en "\tcaps osd = \"allow rwx pool=rbd" >>/tmp
/keyring-
$user
24 for i
in $
(seq 1 $n); do
25 echo -n ", allow rwx pool=pool$i" >>/tmp
/keyring-
$user
27 echo "\"" >>/tmp
/keyring-
$user
31 generate_keyring foo
1000 # ~25K, kmalloc
32 generate_keyring bar
20000 # ~500K, vmalloc
33 generate_keyring baz
300000 # ~8M, vmalloc + sg chaining
35 rbd create
--size 1 test
37 for user
in {foo
,bar
,baz
}; do
38 ceph auth import
-i /tmp
/keyring-
$user
39 DEV
=$
(sudo rbd map
-n client.
$user --keyring /tmp
/keyring-
$user test)