diff options
author | Daniil Tatianin <d-tatianin@yandex-team.ru> | 2022-12-22 14:52:28 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-12-26 12:01:36 +0300 |
commit | 13a7c8964afcd8ca43c0b6001ebb0127baa95362 (patch) | |
tree | e58dee6904370958ab5b6aaf6371dc874cce819b /tools/perf/scripts/python/stackcollapse.py | |
parent | 399ab7fe0fa0d846881685fd4e57e9a8ef7559f7 (diff) | |
download | linux-13a7c8964afcd8ca43c0b6001ebb0127baa95362.tar.xz |
qlcnic: prevent ->dcb use-after-free on qlcnic_dcb_enable() failure
adapter->dcb would get silently freed inside qlcnic_dcb_enable() in
case qlcnic_dcb_attach() would return an error, which always happens
under OOM conditions. This would lead to use-after-free because both
of the existing callers invoke qlcnic_dcb_get_info() on the obtained
pointer, which is potentially freed at that point.
Propagate errors from qlcnic_dcb_enable(), and instead free the dcb
pointer at callsite using qlcnic_dcb_free(). This also removes the now
unused qlcnic_clear_dcb_ops() helper, which was a simple wrapper around
kfree() also causing memory leaks for partially initialized dcb.
Found by Linux Verification Center (linuxtesting.org) with the SVACE
static analysis tool.
Fixes: 3c44bba1d270 ("qlcnic: Disable DCB operations from SR-IOV VFs")
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions