Comment 23 for bug 1851553

Revision history for this message
Mauricio Faria de Oliveira (mfo) wrote :

Verification done with bionic-proposed.
bind() fails with ETIMEDOUT and stress-ng finishes successfully.
--

$ multipass launch --cpus 4 --mem 4G --disk 4G --name lp1851553-b bionic
$ multipass shell lp1851553-b

$ echo "deb http://archive.ubuntu.com/ubuntu $(lsb_release -cs)-proposed universe" | sudo tee /etc/apt/sources.list.d/proposed.list
$ sudo apt update
$ sudo apt install -y stress-ng
$ sudo rm /etc/apt/sources.list.d/proposed.list

$ sudo apt install -y gcc make libelf-dev linux-headers-$(uname -r)

$ wget https://bugs.launchpad.net/ubuntu/+source/stress-ng/+bug/1851553/+attachment/5308835/+files/kmod_bionic.c -O kmod.c

$ cat <<"EOF" | sed 's/^TAB/\t/' >Makefile
obj-m := kmod.o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
TAB$(MAKE) -C $(KDIR) M=$(PWD) modules
clean:
TAB$(MAKE) -C $(KDIR) M=$(PWD) clean
EOF

$ make

$ lsb_release -cs
bionic

$ dpkg -s stress-ng | grep ^Version
Version: 0.09.25-1ubuntu5

$ uname -rv
4.15.0-70-generic #79-Ubuntu SMP Tue Nov 12 10:36:11 UTC 2019

$ stress-ng --af-alg 2 -t 20

$ sudo modprobe -r md4
$ sudo insmod kmod.ko

$ strace -e bind -o stress-ng_strace_bind.proposed_kmod -f -- stress-ng --af-alg 2 -t 120
stress-ng: info: [18926] dispatching hogs: 2 af-alg
stress-ng: info: [18926] successful run completed in 120.03s (2 mins, 0.03 secs)

$ sudo rmmod kmod

$ grep -e ETIMEDOUT -e 'exited with' stress-ng_strace_bind.proposed_kmod
18927 bind(4, {sa_family=AF_ALG, sa_data="hash\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0md4\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, 88) = -1 ETIMEDOUT (Connection timed out)
18928 +++ exited with 0 +++
18927 +++ exited with 0 +++
18926 +++ exited with 0 +++

$ dmesg
...
[ 559.745309] kmod: loading out-of-tree module taints kernel.
[ 559.745423] kmod: module verification failed: signature and/or required key missing - tainting kernel
[ 559.745880] hello
[ 567.570886] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '18928', (original) return value '0'
[ 567.574235] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '18928', (modified) return value '-62' (FIRST PID) -- ensure crypto_larval_lookup() calls crypto_larval_add().
[ 567.579835] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '18927', (original) return value '0'
[ 567.581534] down_write(&crypto_alg_sem) in FIRST PID, FIRST CALL. sleep 15 seconds -- wait OTHER PID/__crypto_register_alg()
[ 567.585936] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '18927', sleep for 10 seconds (OTHER PID) -- wait FIRST PID/crypto_larval_add()/down_write(&crypto_rwsem)
[ 577.782958] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '18927', slept for 10 seconds (OTHER PID)
[ 577.945825] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '18927', (original) return value '0'
[ 577.952874] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '18927', sleep for 10 seconds (OTHER PID) -- wait FIRST PID/crypto_larval_add()/down_write(&crypto_rwsem)
[ 582.646905] down_write(&crypto_alg_sem) in FIRST PID, FIRST CALL. slept 15 seconds
[ 582.826710] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '18928', (original) return value '0'
[ 582.830011] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '18928', sleep for 10 seconds (OTHER PID) -- wait FIRST PID/crypto_larval_add()/down_write(&crypto_rwsem)
[ 588.022795] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '18927', slept for 10 seconds (OTHER PID)
[ 588.171896] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '18927', (original) return value '0'
[ 588.177406] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '18927', sleep for 10 seconds (OTHER PID) -- wait FIRST PID/crypto_larval_add()/down_write(&crypto_rwsem)
[ 592.886701] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '18928', slept for 10 seconds (OTHER PID)
[ 592.905739] crypto_alg_tested("md4-generic"), sleep 70 seconds. pid = 18957 -- expire the 60-second timeout of FIRST_PID/crypto_larval_add()/crypto_larval_wait()
[ 598.262647] security_kernel_module_request() module 'crypto-md4', comm 'stress-ng-af-al', pid '18927', slept for 10 seconds (OTHER PID)
[ 664.822719] crypto_alg_tested("md4-generic"), slept 70 seconds
[ 711.591809] bye