linux-stable/drivers/net/ethernet/marvell
Zhou Qingyang e07a097b49 octeontx2-af: Fix a memleak bug in rvu_mbox_init()
In rvu_mbox_init(), mbox_regions is not freed or passed out
under the switch-default region, which could lead to a memory leak.

Fix this bug by changing 'return err' to 'goto free_regions'.

This bug was found by a static analyzer. The analysis employs
differential checking to identify inconsistent security operations
(e.g., checks or kfrees) between two code paths and confirms that the
inconsistent operations are not recovered in the current function or
the callers, so they constitute bugs.

Note that, as a bug found by static analysis, it can be a false
positive or hard to trigger. Multiple researchers have cross-reviewed
the bug.

Builds with CONFIG_OCTEONTX2_AF=y show no new warnings,
and our static analyzer no longer warns about this code.

Fixes: 98c5611163 (“octeontx2-af: cn10k: Add mbox support for CN10K platform”)
Signed-off-by: Zhou Qingyang <zhou1615@umn.edu>
Link: https://lore.kernel.org/r/20211130165039.192426-1-zhou1615@umn.edu
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-12-01 19:11:05 -08:00
..
mvpp2 net: marvell: mvpp2: Fix the computation of shared CPUs 2021-11-30 12:05:16 +00:00
octeontx2 octeontx2-af: Fix a memleak bug in rvu_mbox_init() 2021-12-01 19:11:05 -08:00
prestera net: marvell: prestera: fix double free issue on err path 2021-11-19 11:20:55 +00:00
Kconfig net: marvell: Remove reference to CONFIG_MV64X60 2021-03-18 14:19:39 -07:00
Makefile
mv643xx_eth.c ethernet: mv643xx: use eth_hw_addr_set() 2021-10-19 12:41:47 +01:00
mvmdio.c net: mvmdio: fix compilation warning 2021-11-16 18:55:17 -08:00
mvneta.c net: mvneta: drop use of phylink_helper_basex_speed() 2021-10-27 14:50:11 +01:00
mvneta_bm.c
mvneta_bm.h
pxa168_eth.c net: convert users of bitmap_foo() to linkmode_foo() 2021-10-24 13:58:52 +01:00
skge.c ethernet: sky2/skge: use eth_hw_addr_set() 2021-10-19 12:41:47 +01:00
skge.h net: marvell: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00
sky2.c sky2: Remove redundant assignment and parentheses 2021-10-28 14:39:06 +01:00
sky2.h net: marvell: remove leading spaces before tabs 2021-05-19 12:17:31 -07:00