Re: [PATCH] brcmfmac: avoid writing channel out of allocated array

2017-01-04 Thread Kalle Valo
Rafał Miłecki writes: >>> @@ -5873,33 +5872,33 @@ static int brcmf_construct_chaninfo(struct >>> brcmf_cfg80211_info *cfg, >>> ch.bw == BRCMU_CHAN_BW_80) >>> continue; >>> >>> - channel = band->channels; >>> - index = band->n_channe

Re: [PATCH] brcmfmac: avoid writing channel out of allocated array

2017-01-04 Thread Kalle Valo
Rafał Miłecki writes: > On 3 January 2017 at 15:14, Rafał Miłecki wrote: >> On 3 January 2017 at 14:19, Arend Van Spriel >> wrote: >>> On 3-1-2017 12:31, Rafał Miłecki wrote: >> + if (!channel) { >> + brcmf_err("Firmware reported unexpected channel >

Re: [PATCH] brcmfmac: avoid writing channel out of allocated array

2017-01-04 Thread Kalle Valo
Arend Van Spriel writes: > On 3-1-2017 9:38, Rafał Miłecki wrote: >> From: Rafał Miłecki >> >> 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

Re: [PATCH] brcmfmac: avoid writing channel out of allocated array

2017-01-03 Thread Rafał Miłecki
On 3 January 2017 at 15:14, Rafał Miłecki wrote: > On 3 January 2017 at 14:19, Arend Van Spriel > wrote: >> On 3-1-2017 12:31, Rafał Miłecki wrote: > + if (!channel) { > + brcmf_err("Firmware reported unexpected channel > %d\n", > +

Re: [PATCH] brcmfmac: avoid writing channel out of allocated array

2017-01-03 Thread Arend Van Spriel
On 3-1-2017 12:31, Rafał Miłecki wrote: >>> + if (!channel) { >>> + brcmf_err("Firmware reported unexpected channel %d\n", >>> + ch.control_ch_num); >>> + continue; >>> + } >> As stated above something is

Re: [PATCH] brcmfmac: avoid writing channel out of allocated array

2017-01-03 Thread Rafał Miłecki
On 3 January 2017 at 14:19, Arend Van Spriel wrote: > On 3-1-2017 12:31, Rafał Miłecki wrote: + if (!channel) { + brcmf_err("Firmware reported unexpected channel %d\n", + ch.control_ch_num); +

Re: [PATCH] brcmfmac: avoid writing channel out of allocated array

2017-01-03 Thread Rafał Miłecki
On 3 January 2017 at 12:02, Arend Van Spriel wrote: > On 3-1-2017 9:38, Rafał Miłecki wrote: >> From: Rafał Miłecki >> >> 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

Re: [PATCH] brcmfmac: avoid writing channel out of allocated array

2017-01-03 Thread Arend Van Spriel
On 3-1-2017 9:38, Rafał Miłecki wrote: > From: Rafał Miłecki > > 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. > > Fix this by detecting

[PATCH] brcmfmac: avoid writing channel out of allocated array

2017-01-03 Thread Rafał Miłecki
From: Rafał Miłecki 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. Fix this by detecting unexpected channel and ignoring it. Fixes: 58de92d2f