]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
iwlwifi: mvm: writing zero bytes to debugfs causes a crash
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 23 Mar 2017 10:40:00 +0000 (13:40 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 24 Mar 2017 15:15:25 +0000 (17:15 +0200)
commit251fe09f13bfb54c1ede66ee8bf8ddd0061c4f7c
tree60b08dcc4a18caeec4c72c9fae59307c2fe2d579
parenta95600294157ca7527ee7c70249fb53e09d8c566
iwlwifi: mvm: writing zero bytes to debugfs causes a crash

This is a static analysis fix.  The warning is:

drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c:912 iwl_mvm_fw_dbg_collect()
warn: integer overflows 'sizeof(*desc) + len'

I guess this code is supposed to take a NUL character, but if we write
zero bytes then it tries to write -1 characters and crashes.

Fixes: c91b865cb14d ("iwlwifi: mvm: support description for user triggered fw dbg collection")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c