08 Jan, 2016
3 commits
-
We might want to test for bugs like that found in commit f9692b2699bd
("firmware: fix possible use after free on name on asynchronous
request"), where the asynchronous request API had race conditions.Let's add a simple file that will launch the async request, then wait
until it's complete and report the status. It's not a true async test
(we're using a mutex + wait_for_completion(), so we can't get more than
one going at the same time), but it does help make sure the basic API is
sane, and it can catch some class of bugs.Signed-off-by: Brian Norris
Cc: Luis R. Rodriguez
Acked-by: Kees Cook
Signed-off-by: Shuah Khan -
We're essentially just doing an open-coded kstrndup(). The only
differences are with what happens after the first '\0' character, but
request_firmware() doesn't care about that.Suggested-by: Kees Cook
Signed-off-by: Brian Norris
Signed-off-by: Shuah Khan -
request_firmware() failures currently won't get reported at all (the
error code is discarded). What's more, we get confusing messages, like:# echo -n notafile > /sys/devices/virtual/misc/test_firmware/trigger_request
[ 8280.311856] test_firmware: loading 'notafile'
[ 8280.317042] test_firmware: load of 'notafile' failed: -2
[ 8280.322445] test_firmware: loaded: 0
# echo $?
0Report the failures via write() errors, and don't say we "loaded"
anything.Signed-off-by: Brian Norris
Acked-by: Kees Cook
Signed-off-by: Shuah Khan
18 Jul, 2014
1 commit
-
This provides a simple interface to trigger the firmware_class loader
to test built-in, filesystem, and user helper modes. Additionally adds
tests via the new interface to the selftests tree.Signed-off-by: Kees Cook
Signed-off-by: Greg Kroah-Hartman