#!/usr/bin/env bash
# Note: build and _install_ the toolkit first!
set -u
if [ ${BASH_VERSINFO} -lt 3 ] ; then
echo 'Error: Your bash need to be version 3 or newer. Exiting.'
exit 1 # operators like =~ produce errors silently in old bash versions, so exit here
fi
archive='ftp://wireshark.org/automated/captures/'
show_output='' # empty string evaluates to false
run_through='' # empty string evaluates to false
count_cores=0
count_files=0
netsniff_ng_opts=''
if [ $# -gt 0 ] ; then
if [ "$1" = '-h' -o "$1" = '--help' -o "$1" = '--usage' ] ; then
echo 'Usage: dissector_fuzz [-s (show netsniff-ng output, default: no)] [-r (keep running on errors, default: no)] [netsniff-ng long-args]'
exit 0
fi
for opt in $@ ; do
if [ "${opt}" = '-s' ] ; then
show_output='true'
elif [ "${opt}" = '-r' ] ; then
run_through='true'
else
netsniff_ng_opts="${netsniff_ng_opts} ${opt}";
fi
done
fi
mkdir -p fuzzing
cd fuzzing
wget -r -Nc -np -nd -A.pcap "$archive" |& grep -E "%|^--"
ulimit -c unlimited
rm -f core
for file in *.pcap
do
echo "Testing file $file ..."
if [ $show_output ]; then
netsniff-ng --in "$file" "${netsniff_ng_opts}"
else
netsniff-ng --in "$file" "${netsniff_ng_opts}" > /dev/null
fi
if [ -e core ]; then
echo "Fuck, core dumped on $file!"
let count_cores=count_cores+1
if [ $run_through ]; then
rm core
else
exit
fi
fi
done
if which cowsay > /dev/null ; then
echo_cmd='cowsay'
else
echo_cmd='echo'
fi
${echo_cmd} 'Your fuckup Score'
echo " * tested pcaps: $count_files"
echo " * core dumps: $count_cores"
cgit.cgi/linux/net-next.git/refs/?id=7a7b5df84b6b4e5d599c7289526eed96541a0654'>refslogtreecommitdiff
HID: cp2112: fix sleep-while-atomic
A recent commit fixing DMA-buffers on stack added a shared transfer
buffer protected by a spinlock. This is broken as the USB HID request
callbacks can sleep. Fix this up by replacing the spinlock with a mutex.
Fixes: 1ffb3c40ffb5 ("HID: cp2112: make transfer buffers DMA capable")
Cc: stable <stable@vger.kernel.org> # 4.9
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>