Skip to content

update NULL pointer handling in generated code

Thaison Phan lkml netdev 2 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 0 repliesApplied 2/2
  2. v12 patches 5 repliesSuperseded

Changes in v2 from the cover letter

- Moved null check in dump list free to be separate from while loop
- Updated allocation checks to only be for getters as setters will be handled in a separate patch.

Patches in v2 All 2 applied

#Subject and filesSizeRepliesApplied
1/2tools: ynl: check for null ptr on dump freetools/net/ynl/pyynl/ynl_gen_c.py+3 -00 repliesApplied
2/2tools: ynl: check alloc fails in generated getter codetools/net/ynl/pyynl/ynl_gen_c.py+24 -80 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 net-next 0/2] update NULL pointer handling in generated code

This series fixes potential NULL pointer dereferences in YNL-generated C code during dump list freeing and memory allocation in parsing getters.

Changes in v2:
- Moved null check in dump list free to be separate from while loop
- Updated allocation checks to only be for getters as setters will be handled in a separate patch.

Testing:
- Regenerated all c headers/sources under tools/net/ynl/generated/
- Built libynl, ynltool, and test binaries without errors or warnings
- Ran make target run_tests in tools/net/ynl/tests successfully
- Ran tools/testing/selftests/drivers/net/psp.py in QEMU x86_64 successfully

v1:
https://lore.kernel.org/netdev/[email protected]/

Thaison Phan (2):
tools: ynl: check for null ptr on dump free
tools: ynl: check alloc fails in generated getter code

 tools/net/ynl/pyynl/ynl_gen_c.py | 35 ++++++++++++++++++++++++--------
 1 file changed, 27 insertions(+), 8 deletions(-)
Signature · 1 line
2.55.0.654.g21b8a5bc05-goog