Bluetooth: Collect kcov coverage from hci_rx_work
authorTamas Koczka <poprdi@google.com>
Thu, 14 Jul 2022 10:48:14 +0000 (10:48 +0000)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 22 Jul 2022 00:09:06 +0000 (17:09 -0700)
commit9f30de9e0343da05ac621b5817e9b1ce303c6310
treea769f99f18a897b77e4b665fdf3e1a2215e00260
parent68253f3cd715e819bc4bff2b0e6b21234e259d56
Bluetooth: Collect kcov coverage from hci_rx_work

Annotate hci_rx_work() with kcov_remote_start() and kcov_remote_stop()
calls, so remote KCOV coverage is collected while processing the rx_q
queue which is the main incoming Bluetooth packet queue.

Coverage is associated with the thread which created the packet skb.

The collected extra coverage helps kernel fuzzing efforts in finding
vulnerabilities.

This change only has effect if the kernel is compiled with CONFIG_KCOV,
otherwise kcov_ functions don't do anything.

Signed-off-by: Tamas Koczka <poprdi@google.com>
Tested-by: Aleksandr Nogikh <nogikh@google.com>
Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/hci_core.c