Two memory safety issues in the zxdh driver, both found with<br />gcc -fanalyzer:<br /> <br />- zxdh_get_res_info() copies a reply length taken from the device into<br />  a caller buffer whose size it is not told. Both callers pass a<br />  one-byte object, so an oversized length overwrites their stack, and<br />  a length above the receive buffer size also overruns that buffer<br />  (patch 1).<br />- fd_flow_parse_pattern() and fd_flow_parse_action() allocate a flow<br />  entry when rte_flow_validate() passes dh_flow as NULL, and free it<br />  on only one exit, so every validate leaks memory (patch 2).<br /> <br />Junlong Wang (2):<br />  net/zxdh: bound resource table reply length before copying<br />  net/zxdh: avoid leaking flow entry on validation<br /> <br /> drivers/net/zxdh/zxdh_common.c | 24 ++++++++++----<br /> drivers/net/zxdh/zxdh_flow.c   | 58 ++++++++++------------------------<br /> 2 files changed, 33 insertions(+), 49 deletions(-)<br /> <br />--  <br />2.27.0<br />