1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/ethernet/marvell/octeontx2/af
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
..
cgx.c ethernet: Remove redundant 'flush_workqueue()' calls 2021-10-10 11:33:15 +01:00
cgx.h octeontx2-af: Fix inconsistent license text 2021-08-29 10:46:15 +01:00
cgx_fw_if.h octeontx2-af: Fix inconsistent license text 2021-08-29 10:46:15 +01:00
common.h octeontx2-af: Hardware configuration for inline IPsec 2021-09-16 14:37:38 +01:00
lmac_common.h octeontx2-af: cn10k: RPM hardware timestamp configuration 2021-09-28 13:50:37 +01:00
Makefile octeontx2-af: Fix inconsistent license text 2021-08-29 10:46:15 +01:00
mbox.c octeontx2-af: Fix inconsistent license text 2021-08-29 10:46:15 +01:00
mbox.h octeontx2-af: Add support to flush full CPT CTX cache 2021-10-14 20:01:06 -07:00
npc.h octeontx2-af: debugfs: Add channel and channel mask. 2021-10-28 14:49:29 +01:00
npc_profile.h octeontx2-af: Increase number of reserved entries in KPU 2021-10-24 13:36:51 +01:00
ptp.c octeontx2-af: Add external ptp input clock 2021-09-28 13:50:37 +01:00
ptp.h octeontx2-af: Add external ptp input clock 2021-09-28 13:50:37 +01:00
rpm.c octeontx2-af: cn10k: RPM hardware timestamp configuration 2021-09-28 13:50:37 +01:00
rpm.h octeontx2-af: cn10k: RPM hardware timestamp configuration 2021-09-28 13:50:37 +01:00
rvu.c octeontx2-af: Fix a memleak bug in rvu_mbox_init() 2021-12-01 19:11:05 -08:00
rvu.h octeontx2-af: Add support to flush full CPT CTX cache 2021-10-14 20:01:06 -07:00
rvu_cgx.c ethernet: Remove redundant 'flush_workqueue()' calls 2021-10-10 11:33:15 +01:00
rvu_cn10k.c octeontx2-af: Hardware configuration for inline IPsec 2021-09-16 14:37:38 +01:00
rvu_cpt.c octeontx2-af: Add support to flush full CPT CTX cache 2021-10-14 20:01:06 -07:00
rvu_debugfs.c octeontx2-af: debugfs: don't corrupt user memory 2021-11-17 20:25:40 -08:00
rvu_devlink.c octeontx2: Move devlink registration to be last devlink command 2021-09-27 16:31:59 +01:00
rvu_devlink.h octeontx2-af: Fix inconsistent license text 2021-08-29 10:46:15 +01:00
rvu_nix.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-10-28 10:43:58 -07:00
rvu_npa.c octeontx2-af: Fix inconsistent license text 2021-08-29 10:46:15 +01:00
rvu_npc.c octeontx2-af: use swap() to make code cleaner 2021-11-05 10:14:38 +00:00
rvu_npc_fs.c octeontx2-af: debugfs: Add channel and channel mask. 2021-10-28 14:49:29 +01:00
rvu_reg.c octeontx2-af: Fix inconsistent license text 2021-08-29 10:46:15 +01:00
rvu_reg.h octeontx2-af: Add support to flush full CPT CTX cache 2021-10-14 20:01:06 -07:00
rvu_sdp.c octeontx2-af: Fix inconsistent license text 2021-08-29 10:46:15 +01:00
rvu_struct.h octeontx2-af: Enable CPT HW interrupts 2021-10-14 20:01:06 -07:00
rvu_switch.c octeontx2-af: Fix inconsistent license text 2021-08-29 10:46:15 +01:00
rvu_trace.c octeontx2-af: Fix inconsistent license text 2021-08-29 10:46:15 +01:00
rvu_trace.h octeontx2-af: Fix inconsistent license text 2021-08-29 10:46:15 +01:00