summaryrefslogtreecommitdiff
path: root/drivers/nubus
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2017-01-04 11:09:41 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-07-05 12:40:30 (GMT)
commit8ee785016d5a05afa9ddd872ae7befa11798bfbf (patch)
treeda9272a0eb6df1b5176141841f1875972d58a021 /drivers/nubus
parent65fc82cea84f38ce918553b557f3a24c8d8c9649 (diff)
downloadlinux-8ee785016d5a05afa9ddd872ae7befa11798bfbf.tar.xz
brcmfmac: avoid writing channel out of allocated array
commit 77c0d0cd10e793989d1e8b835a9a09694182cb39 upstream. Our code was assigning number of channels to the index variable by default. If firmware reported channel we didn't predict this would result in using that initial index value and writing out of array. This never happened so far (we got a complete list of supported channels) but it means possible memory corruption so we should handle it anyway. This patch simply detects unexpected channel and ignores it. As we don't try to create new entry now, it's also safe to drop hw_value and center_freq assignment. For known channels we have these set anyway. I decided to fix this issue by assigning NULL or a target channel to the channel variable. This was one of possible ways, I prefefred this one as it also avoids using channel[index] over and over. Fixes: 58de92d2f95e ("brcmfmac: use static superset of channels for wiphy bands") Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/nubus')
0 files changed, 0 insertions, 0 deletions