]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
ar5523: check NULL before memcpy() in ar5523_cmd()
authorDenis Efremov <efremov@linux.com>
Mon, 30 Sep 2019 20:31:47 +0000 (23:31 +0300)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:23:52 +0000 (14:23 -0300)
commitcb9e63cf0010190daeefda6e96a11dd618f090b6
treee3f2f8c684909577ccde0b13b7344d0d9a5e10ce
parentcc1e87f087fdbd52c6b591662b9e7e84dc8009f7
ar5523: check NULL before memcpy() in ar5523_cmd()

BugLink: https://bugs.launchpad.net/bugs/1856869
commit 315cee426f87658a6799815845788fde965ddaad upstream.

memcpy() call with "idata == NULL && ilen == 0" results in undefined
behavior in ar5523_cmd(). For example, NULL is passed in callchain
"ar5523_stat_work() -> ar5523_cmd_write() -> ar5523_cmd()". This patch
adds ilen check before memcpy() call in ar5523_cmd() to prevent an
undefined behavior.

Cc: Pontus Fuchs <pontus.fuchs@gmail.com>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: David Laight <David.Laight@ACULAB.COM>
Cc: stable@vger.kernel.org
Signed-off-by: Denis Efremov <efremov@linux.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/wireless/ath/ar5523/ar5523.c