Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at master 43 lines 1.6 kB view raw
1Testing for regressions in Media Controller API register, ioctl, syscall, 2and unregister paths. There have a few problems that result in use-after 3free on media_device, media_devnode, and cdev pointers when the driver is 4unbound while ioctl is in progress. 5 6Test Procedure: 7 8Run bin/unbind loop while ioctls are in progress. 9Run rmmod and modprobe. 10Disconnect the device. 11 12Setup: 13 14Build media_device_test 15cd tools/testing/selftests/media_tests 16make 17 18Regressions test for cdev use-after-free error on /dev/mediaX when driver 19is unbound: 20 21Start media_device_test to regression test media devnode dynamic alloc 22and cdev use-after-free fixes. This opens media dev files and sits in 23a loop running media ioctl MEDIA_IOC_DEVICE_INFO command once every 10 24seconds. The idea is when device file goes away, media devnode and cdev 25should stick around until this test exits. 26 27The test for a random number of iterations or until user kills it with a 28sleep 10 in between the ioctl calls. 29 30sudo ./media_device_test -d /dev/mediaX 31 32Regression test for media_devnode unregister race with ioctl_syscall: 33 34Start 6 open_loop_test.sh tests with different /dev/mediaX files. When 35device file goes away after unbind, device file name changes. Start the 36test with possible device names. If we start with /dev/media0 for example, 37after unbind, /dev/media1 or /dev/media2 could get created. The idea is 38keep ioctls going while bind/unbind runs. 39 40Copy bind_unbind_sample.txt and make changes to specify the driver name 41and number to run bind and unbind. Start the bind_unbind.sh 42 43Run dmesg looking for any use-after-free errors or mutex lock errors.