From: Luca Coelho <luca@coelho.fi>
To: Dan Carpenter <dan.carpenter@oracle.com>,
Johannes Berg <johannes.berg@intel.com>,
Golan Ben-Ami <golan.ben.ami@intel.com>
Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>,
Intel Linux Wireless <linuxwifi@intel.com>,
Kalle Valo <kvalo@codeaurora.org>,
Sara Sharon <sara.sharon@intel.com>, Ido Yariv <ido@wizery.com>,
linux-wireless@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] iwlwifi: mvm: writing zero bytes to debugfs causes a crash
Date: Thu, 23 Mar 2017 12:25:44 +0000 [thread overview]
Message-ID: <1490271944.2700.63.camel@coelho.fi> (raw)
In-Reply-To: <20170323104000.GB20154@mwanda>
On Thu, 2017-03-23 at 13:40 +0300, Dan Carpenter wrote:
> 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>
>
> diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
> index a260cd503200..077bfd8f4c0c 100644
> --- 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_write(struct iwl_mvm *mvm,
>
> if (ret)
> return ret;
> + if (count = 0)
> + return 0;
>
> iwl_mvm_fw_dbg_collect(mvm, FW_DBG_TRIGGER_USER, buf,
> (count - 1), NULL);
Thanks! I'm going to push this via our internal tree.
--
Cheers,
Luca.
prev parent reply other threads:[~2017-03-23 12:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-23 10:40 [PATCH] iwlwifi: mvm: writing zero bytes to debugfs causes a crash Dan Carpenter
2017-03-23 12:25 ` Luca Coelho [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1490271944.2700.63.camel@coelho.fi \
--to=luca@coelho.fi \
--cc=dan.carpenter@oracle.com \
--cc=emmanuel.grumbach@intel.com \
--cc=golan.ben.ami@intel.com \
--cc=ido@wizery.com \
--cc=johannes.berg@intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linuxwifi@intel.com \
--cc=sara.sharon@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox