summaryrefslogtreecommitdiff
path: root/drivers/cpufreq/at32ap-cpufreq.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2020-03-18 00:27:19 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-03-20 09:06:30 +0100
commit664ea109c4dc346cd683ce8d49164b3833e321f9 (patch)
treea1e653f335e23cf5e194fef852e419f7723e7342 /drivers/cpufreq/at32ap-cpufreq.c
parente405cdd9403b6bb17803daa55ee12b9ee29631e9 (diff)
batman-adv: Avoid race in TT TVLV allocator helper
commit 8ba0f9bd3bdea1058c2b2676bec7905724418e40 upstream. The functions batadv_tt_prepare_tvlv_local_data and batadv_tt_prepare_tvlv_global_data are responsible for preparing a buffer which can be used to store the TVLV container for TT and add the VLAN information to it. This will be done in three phases: 1. count the number of VLANs and their entries 2. allocate the buffer using the counters from the previous step and limits from the caller (parameter tt_len) 3. insert the VLAN information to the buffer The step 1 and 3 operate on a list which contains the VLANs. The access to these lists must be protected with an appropriate lock or otherwise they might operate on on different entries. This could for example happen when another context is adding VLAN entries to this list. This could lead to a buffer overflow in these functions when enough entries were added between step 1 and 3 to the VLAN lists that the buffer room for the entries (*tt_change) is smaller then the now required extra buffer for new VLAN entries. Fixes: 7ea7b4a14275 ("batman-adv: make the TT CRC logic VLAN specific") Signed-off-by: Sven Eckelmann <sven@narfation.org> Acked-by: Antonio Quartulli <a@unstable.cc> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/cpufreq/at32ap-cpufreq.c')
0 files changed, 0 insertions, 0 deletions