0001 Testing for regressions in Media Controller API register, ioctl, syscall,
0002 and unregister paths. There have a few problems that result in user-after
0003 free on media_device, media_devnode, and cdev pointers when the driver is
0004 unbound while ioctl is in progress.
0005
0006 Test Procedure:
0007
0008 Run bin/unbind loop while ioctls are in progress.
0009 Run rmmod and modprobe.
0010 Disconnect the device.
0011
0012 Setup:
0013
0014 Build media_device_test
0015 cd tools/testing/selftests/media_tests
0016 make
0017
0018 Regressions test for cdev user-after free error on /dev/mediaX when driver
0019 is unbound:
0020
0021 Start media_device_test to regression test media devnode dynamic alloc
0022 and cdev user-after-free fixes. This opens media dev files and sits in
0023 a loop running media ioctl MEDIA_IOC_DEVICE_INFO command once every 10
0024 seconds. The idea is when device file goes away, media devnode and cdev
0025 should stick around until this test exits.
0026
0027 The test for a random number of iterations or until user kills it with a
0028 sleep 10 in between the ioctl calls.
0029
0030 sudo ./media_device_test -d /dev/mediaX
0031
0032 Regression test for media_devnode unregister race with ioctl_syscall:
0033
0034 Start 6 open_loop_test.sh tests with different /dev/mediaX files. When
0035 device file goes away after unbind, device file name changes. Start the
0036 test with possible device names. If we start with /dev/media0 for example,
0037 after unbind, /dev/media1 or /dev/media2 could get created. The idea is
0038 keep ioctls going while bind/unbind runs.
0039
0040 Copy bind_unbind_sample.txt and make changes to specify the driver name
0041 and number to run bind and unbind. Start the bind_unbind.sh
0042
0043 Run dmesg looking for any user-after free errors or mutex lock errors.