The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v2 net-next 0/2] update NULL pointer handling in generated code
@ 2026-08-07 17:14 Thaison Phan
  2026-08-07 17:14 ` [PATCH v2 net-next 1/2] tools: ynl: check for null ptr on dump free Thaison Phan
  2026-08-07 17:15 ` [PATCH v2 net-next 2/2] tools: ynl: check alloc fails in generated getter code Thaison Phan
  0 siblings, 2 replies; 3+ messages in thread
From: Thaison Phan @ 2026-08-07 17:14 UTC (permalink / raw)
  To: Jakub Kicinski, Donald Hunter, David S . Miller , Eric Dumazet,
	Paolo Abeni
  Cc: Simon Horman, Fengyuan Gong, Stan Iliev,
	Asbjørn Sloth Tønnesen, Matthieu Baerts (NGI0),
	Thaison Phan, netdev, linux-kernel

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/20260803201652.2752685-1-thaisonphan@google.com/

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(-)

-- 
2.55.0.654.g21b8a5bc05-goog


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-07 17:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-07 17:14 [PATCH v2 net-next 0/2] update NULL pointer handling in generated code Thaison Phan
2026-08-07 17:14 ` [PATCH v2 net-next 1/2] tools: ynl: check for null ptr on dump free Thaison Phan
2026-08-07 17:15 ` [PATCH v2 net-next 2/2] tools: ynl: check alloc fails in generated getter code Thaison Phan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox