All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thaison Phan <thaisonphan@google.com>
To: Jakub Kicinski <kuba@kernel.org>,
	Donald Hunter <donald.hunter@gmail.com>,
	 "David S . Miller " <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	 Paolo Abeni <pabeni@redhat.com>
Cc: "Simon Horman" <horms@kernel.org>,
	"Fengyuan Gong" <gfengyuan@google.com>,
	"Stan Iliev" <stani@google.com>,
	"Asbjørn Sloth Tønnesen" <ast@fiberby.net>,
	"Matthieu Baerts (NGI0)" <matttbe@kernel.org>,
	"Thaison Phan" <thaisonphan@google.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 net-next 0/2] update NULL pointer handling in generated code
Date: Fri,  7 Aug 2026 17:14:58 +0000	[thread overview]
Message-ID: <20260807171500.7188-1-thaisonphan@google.com> (raw)

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


             reply	other threads:[~2026-08-07 17:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-07 17:14 Thaison Phan [this message]
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
2026-08-11  1:30 ` [PATCH v2 net-next 0/2] update NULL pointer handling in generated code patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260807171500.7188-1-thaisonphan@google.com \
    --to=thaisonphan@google.com \
    --cc=ast@fiberby.net \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=edumazet@google.com \
    --cc=gfengyuan@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matttbe@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stani@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.