stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "iwlwifi: mvm: writing zero bytes to debugfs causes a crash" has been added to the 4.10-stable tree
@ 2017-05-09  9:19 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-05-09  9:19 UTC (permalink / raw)
  To: dan.carpenter, gregkh, luciano.coelho; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    iwlwifi: mvm: writing zero bytes to debugfs causes a crash

to the 4.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     iwlwifi-mvm-writing-zero-bytes-to-debugfs-causes-a-crash.patch
and it can be found in the queue-4.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 251fe09f13bfb54c1ede66ee8bf8ddd0061c4f7c Mon Sep 17 00:00:00 2001
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Thu, 23 Mar 2017 13:40:00 +0300
Subject: iwlwifi: mvm: writing zero bytes to debugfs causes a crash

From: Dan Carpenter <dan.carpenter@oracle.com>

commit 251fe09f13bfb54c1ede66ee8bf8ddd0061c4f7c upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
@@ -1056,6 +1056,8 @@ static ssize_t iwl_dbgfs_fw_dbg_collect_
 
 	if (ret)
 		return ret;
+	if (count == 0)
+		return 0;
 
 	iwl_mvm_fw_dbg_collect(mvm, FW_DBG_TRIGGER_USER, buf,
 			       (count - 1), NULL);


Patches currently in stable-queue which might be from dan.carpenter@oracle.com are

queue-4.10/scsi-scsi_dh_emc-return-success-in-clariion_std_inquiry.patch
queue-4.10/iwlwifi-mvm-writing-zero-bytes-to-debugfs-causes-a-crash.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-05-09  9:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-09  9:19 Patch "iwlwifi: mvm: writing zero bytes to debugfs causes a crash" has been added to the 4.10-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).