net/zxdh: fix issues reported by GCC analyzer
Status from this message: Applied both to next-net and fixed the commit tag AI complained about.
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | net/zxdh: bound resource table reply length before copyingdrivers/ | +17 | 1 reply | |
| 2/2 | net/zxdh: avoid leaking flow entry on validationdrivers/ | +16 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH v1 0/2] net/zxdh: fix issues reported by GCC analyzer
Two memory safety issues in the zxdh driver, both found with gcc -fanalyzer:
- zxdh_get_res_info() copies a reply length taken from the device into a caller buffer whose size it is not told. Both callers pass a one-byte object, so an oversized length overwrites their stack, and a length above the receive buffer size also overruns that buffer (patch 1).
- fd_flow_parse_pattern() and fd_flow_parse_action() allocate a flow entry when rte_flow_validate() passes dh_flow as NULL, and free it on only one exit, so every validate leaks memory (patch 2).
Junlong Wang (2):
net/zxdh: bound resource table reply length before copying net/zxdh: avoid leaking flow entry on validation
drivers/net/zxdh/zxdh_common.c | 24 ++++++++++---- drivers/net/zxdh/zxdh_flow.c | 58 ++++++++++------------------------ 2 files changed, 33 insertions(+), 49 deletions(-)
Signature · 1 line
2.27.0