iwlwifi: fw: harden page loading code
authorLuca Coelho <luciano.coelho@intel.com>
Tue, 13 Feb 2018 09:09:40 +0000 (11:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Jun 2018 23:54:05 +0000 (07:54 +0800)
commit66499586cf7f3a88fa93a1b5c0fe349fea936d82
tree88e0afcadb53d599a5148cc54ed7515d24f1a8a2
parent4ea9a1cd0fc96f046f1131fa85932f1b6ef7923d
iwlwifi: fw: harden page loading code

commit 9039d985811d5b109b58b202b7594fd24e433fed upstream.

The page loading code trusts the data provided in the firmware images
a bit too much and may cause a buffer overflow or copy unknown data if
the block sizes don't match what we expect.

To prevent potential problems, harden the code by checking if the
sizes we are copying are what we expect.

Cc: stable@vger.kernel.org
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/intel/iwlwifi/fw/paging.c