Bluetooth: qca: add missing firmware sanity checks
authorJohan Hovold <johan+linaro@kernel.org>
Tue, 30 Apr 2024 17:07:39 +0000 (19:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 May 2024 09:51:05 +0000 (11:51 +0200)
commited53949cc92e28aaa3463d246942bda1fbb7f307
tree9cdf9b0dccd0a468a8237280cd5da950f1ad8462
parentd68dbfb837c085fde554d1246f113d0bfee4ce99
Bluetooth: qca: add missing firmware sanity checks

commit 2e4edfa1e2bd821a317e7d006517dcf2f3fac68d upstream.

Add the missing sanity checks when parsing the firmware files before
downloading them to avoid accessing and corrupting memory beyond the
vmalloced buffer.

Fixes: 83e81961ff7e ("Bluetooth: btqca: Introduce generic QCA ROME support")
Cc: stable@vger.kernel.org # 4.10
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/bluetooth/btqca.c