From: Kalle Valo <kvalo@codeaurora.org>
To: Denis Efremov <efremov@linux.com>
Cc: linux-wireless@vger.kernel.org, Denis Efremov <efremov@linux.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
wil6210@qti.qualcomm.com, Maya Erez <merez@codeaurora.org>,
"David S. Miller" <davem@davemloft.net>,
stable@vger.kernel.org
Subject: Re: [PATCH] wil6210: check len before memcpy() calls
Date: Wed, 2 Oct 2019 17:23:29 +0000 (UTC) [thread overview]
Message-ID: <20191002172330.4D7A36115A@smtp.codeaurora.org> (raw)
In-Reply-To: <20191001120823.29853-1-efremov@linux.com>
Denis Efremov <efremov@linux.com> wrote:
> memcpy() in wmi_set_ie() and wmi_update_ft_ies() is called with
> src == NULL and len == 0. This is an undefined behavior. Fix it
> by checking "ie_len > 0" before the memcpy() calls.
>
> As suggested by GCC documentation:
> "The pointers passed to memmove (and similar functions in <string.h>)
> must be non-null even when nbytes==0, so GCC can use that information
> to remove the check after the memmove call." [1]
>
> [1] https://gcc.gnu.org/gcc-4.9/porting_to.html
>
> Cc: Maya Erez <merez@codeaurora.org>
> Cc: Kalle Valo <kvalo@codeaurora.org>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: stable@vger.kernel.org
> Signed-off-by: Denis Efremov <efremov@linux.com>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Patch applied to ath-next branch of ath.git, thanks.
2c840676be8f wil6210: check len before memcpy() calls
--
https://patchwork.kernel.org/patch/11168621/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
prev parent reply other threads:[~2019-10-02 17:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-01 12:08 [PATCH] wil6210: check len before memcpy() calls Denis Efremov
2019-10-02 17:23 ` Kalle Valo [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=20191002172330.4D7A36115A@smtp.codeaurora.org \
--to=kvalo@codeaurora.org \
--cc=davem@davemloft.net \
--cc=efremov@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=merez@codeaurora.org \
--cc=netdev@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=wil6210@qti.qualcomm.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;
as well as URLs for NNTP newsgroup(s).