summaryrefslogtreecommitdiff
path: root/net/core
diff options
context:
space:
mode:
authorAlex Elder <elder@linaro.org>2021-05-11 22:42:04 +0300
committerDavid S. Miller <davem@davemloft.net>2021-05-12 02:22:37 +0300
commit440c3247cba3d9433ac435d371dd7927d68772a7 (patch)
treea4ce398aca85ac745d5cd6ede7e319accb981de3 /net/core
parentbcbda3fc616272686208f9c4d5f6dccb65360bd8 (diff)
downloadlinux-440c3247cba3d9433ac435d371dd7927d68772a7.tar.xz
net: ipa: memory region array is variable size
IPA configuration data includes an array of memory region descriptors. That was a fixed-size array at one time, but at some point we started defining it such that it was only as big as required for a given platform. The actual number of entries in the array is recorded in the configuration data along with the array. A loop in ipa_mem_config() still assumes the array has entries for all defined memory region IDs. As a result, this loop can go past the end of the actual array and attempt to write "canary" values based on nonsensical data. Fix this, by stashing the number of entries in the array, and using that rather than IPA_MEM_COUNT in the initialization loop found in ipa_mem_config(). The only remaining use of IPA_MEM_COUNT is in a validation check to ensure configuration data doesn't have too many entries. That's fine for now. Fixes: 3128aae8c439a ("net: ipa: redefine struct ipa_mem_data") Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
0 files changed, 0 insertions, 0 deletions