Search Linux Wireless

Re: [PATCH] wil6210: check len before memcpy() calls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Denis Efremov <efremov@xxxxxxxxx> 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@xxxxxxxxxxxxxx>
> Cc: Kalle Valo <kvalo@xxxxxxxxxxxxxx>
> Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Denis Efremov <efremov@xxxxxxxxx>
> Signed-off-by: Kalle Valo <kvalo@xxxxxxxxxxxxxx>

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




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux