<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/tools/net/ynl/lib, branch v6.6.132</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-06-04T12:42:16+00:00</updated>
<entry>
<title>tools: ynl-gen: validate 0 len strings from kernel</title>
<updated>2025-06-04T12:42:16+00:00</updated>
<author>
<name>David Wei</name>
<email>dw@davidwei.uk</email>
</author>
<published>2025-05-03T04:30:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4e3401aa6e447fd90bda66e65f30479a93b8c9ad'/>
<id>urn:sha1:4e3401aa6e447fd90bda66e65f30479a93b8c9ad</id>
<content type='text'>
[ Upstream commit 4720f9707c783f642332dee3d56dccaefa850e42 ]

Strings from the kernel are guaranteed to be null terminated and
ynl_attr_validate() checks for this. But it doesn't check if the string
has a len of 0, which would cause problems when trying to access
data[len - 1]. Fix this by checking that len is positive.

Signed-off-by: David Wei &lt;dw@davidwei.uk&gt;
Link: https://patch.msgid.link/20250503043050.861238-1-dw@davidwei.uk
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>tools: ynl: don't ignore errors in NLMSG_DONE messages</title>
<updated>2024-05-02T14:32:36+00:00</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2024-04-20T02:08:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6a65f015ee4850f588b1afe9e82569a736a4e696'/>
<id>urn:sha1:6a65f015ee4850f588b1afe9e82569a736a4e696</id>
<content type='text'>
[ Upstream commit a44f2eb106a46f2275a79de54ce0ea63e4f3d8c8 ]

NLMSG_DONE contains an error code, it has to be extracted.
Prior to this change all dumps will end in success,
and in case of failure the result is silently truncated.

Fixes: e4b48ed460d3 ("tools: ynl: add a completely generic client")
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Reviewed-by: Donald Hunter &lt;donald.hunter@gmail.com&gt;
Link: https://lore.kernel.org/r/20240420020827.3288615-1-kuba@kernel.org
Signed-off-by: Paolo Abeni &lt;pabeni@redhat.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>tools: ynl: fix handling of multiple mcast groups</title>
<updated>2024-03-06T14:48:36+00:00</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2024-02-26T21:40:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=dbc81b032dd01f23f231486d262d7b1c1bdc9992'/>
<id>urn:sha1:dbc81b032dd01f23f231486d262d7b1c1bdc9992</id>
<content type='text'>
[ Upstream commit b6c65eb20ffa8e3bd89f551427dbeee2876d72ca ]

We never increment the group number iterator, so all groups
get recorded into index 0 of the mcast_groups[] array.

As a result YNL can only handle using the last group.
For example using the "netdev" sample on kernel with
page pool commands results in:

  $ ./samples/netdev
  YNL: Multicast group 'mgmt' not found

Most families have only one multicast group, so this hasn't
been noticed. Plus perhaps developers usually test the last
group which would have worked.

Fixes: 86878f14d71a ("tools: ynl: user space helpers")
Reviewed-by: Donald Hunter &lt;donald.hunter@gmail.com&gt;
Acked-by: Nicolas Dichtel &lt;nicolas.dichtel@6wind.com&gt;
Link: https://lore.kernel.org/r/20240226214019.1255242-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>tools: ynl: don't leak mcast_groups on init error</title>
<updated>2024-03-01T12:35:09+00:00</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2024-02-20T16:11:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a702e98833420f386cff1986f1517e8cf6585e25'/>
<id>urn:sha1:a702e98833420f386cff1986f1517e8cf6585e25</id>
<content type='text'>
[ Upstream commit 5d78b73e851455d525a064f3b042b29fdc0c1a4a ]

Make sure to free the already-parsed mcast_groups if
we don't get an ack from the kernel when reading family info.
This is part of the ynl_sock_create() error path, so we won't
get a call to ynl_sock_destroy() to free them later.

Fixes: 86878f14d71a ("tools: ynl: user space helpers")
Acked-by: Nicolas Dichtel &lt;nicolas.dichtel@6wind.com&gt;
Link: https://lore.kernel.org/r/20240220161112.2735195-3-kuba@kernel.org
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>tools: ynl: make sure we always pass yarg to mnl_cb_run</title>
<updated>2024-03-01T12:35:09+00:00</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2024-02-20T16:11:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=91addaf5f02b47e82bfd01c4b5100742c5138580'/>
<id>urn:sha1:91addaf5f02b47e82bfd01c4b5100742c5138580</id>
<content type='text'>
[ Upstream commit e4fe082c38cd74a8fa384bc7542cf3edf1cb7318 ]

There is one common error handler in ynl - ynl_cb_error().
It expects priv to be a pointer to struct ynl_parse_arg AKA yarg.
To avoid potential crashes if we encounter a stray NLMSG_ERROR
always pass yarg as priv (or a struct which has it as the first
member).

ynl_cb_null() has a similar problem directly - it expects yarg
but priv passed by the caller is ys.

Found by code inspection.

Fixes: 86878f14d71a ("tools: ynl: user space helpers")
Acked-by: Nicolas Dichtel &lt;nicolas.dichtel@6wind.com&gt;
Link: https://lore.kernel.org/r/20240220161112.2735195-2-kuba@kernel.org
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>tools/net/ynl: Add support for create flags</title>
<updated>2023-08-28T00:17:10+00:00</updated>
<author>
<name>Donald Hunter</name>
<email>donald.hunter@gmail.com</email>
</author>
<published>2023-08-25T12:27:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=1768d8a767f8e7049407fe467364e7ea56f0bdce'/>
<id>urn:sha1:1768d8a767f8e7049407fe467364e7ea56f0bdce</id>
<content type='text'>
Add support for using NLM_F_REPLACE, _EXCL, _CREATE and _APPEND flags
in requests.

Signed-off-by: Donald Hunter &lt;donald.hunter@gmail.com&gt;
Reviewed-by: Jacob Keller &lt;jacob.e.keller@intel.com&gt;
Link: https://lore.kernel.org/r/20230825122756.7603-10-donald.hunter@gmail.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>tools/net/ynl: Implement nlattr array-nest decoding in ynl</title>
<updated>2023-08-28T00:17:10+00:00</updated>
<author>
<name>Donald Hunter</name>
<email>donald.hunter@gmail.com</email>
</author>
<published>2023-08-25T12:27:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0493e56d021d371d3511159a38facbc92969c0f6'/>
<id>urn:sha1:0493e56d021d371d3511159a38facbc92969c0f6</id>
<content type='text'>
Add support for the 'array-nest' attribute type that is used by several
netlink-raw families.

Signed-off-by: Donald Hunter &lt;donald.hunter@gmail.com&gt;
Reviewed-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Reviewed-by: Jacob Keller &lt;jacob.e.keller@intel.com&gt;
Link: https://lore.kernel.org/r/20230825122756.7603-9-donald.hunter@gmail.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>tools/net/ynl: Add support for netlink-raw families</title>
<updated>2023-08-28T00:17:10+00:00</updated>
<author>
<name>Donald Hunter</name>
<email>donald.hunter@gmail.com</email>
</author>
<published>2023-08-25T12:27:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e46dd903efe367214802b8d1cac01bdc43708339'/>
<id>urn:sha1:e46dd903efe367214802b8d1cac01bdc43708339</id>
<content type='text'>
Refactor the ynl code to encapsulate protocol specifics into
NetlinkProtocol and GenlProtocol.

Signed-off-by: Donald Hunter &lt;donald.hunter@gmail.com&gt;
Link: https://lore.kernel.org/r/20230825122756.7603-8-donald.hunter@gmail.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>tools/net/ynl: Fix extack parsing with fixed header genlmsg</title>
<updated>2023-08-28T00:17:10+00:00</updated>
<author>
<name>Donald Hunter</name>
<email>donald.hunter@gmail.com</email>
</author>
<published>2023-08-25T12:27:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fb0a06d455d64443fefea6843ed6c5ae7ee0b395'/>
<id>urn:sha1:fb0a06d455d64443fefea6843ed6c5ae7ee0b395</id>
<content type='text'>
Move decode_fixed_header into YnlFamily and add a _fixed_header_size
method to allow extack decoding to skip the fixed header.

Signed-off-by: Donald Hunter &lt;donald.hunter@gmail.com&gt;
Reviewed-by: Jacob Keller &lt;jacob.e.keller@intel.com&gt;
Link: https://lore.kernel.org/r/20230825122756.7603-7-donald.hunter@gmail.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>tools/ynl: Add mcast-group schema parsing to ynl</title>
<updated>2023-08-28T00:17:10+00:00</updated>
<author>
<name>Donald Hunter</name>
<email>donald.hunter@gmail.com</email>
</author>
<published>2023-08-25T12:27:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=88901b967958eaa70478db1c6ddc8cdea748b2e6'/>
<id>urn:sha1:88901b967958eaa70478db1c6ddc8cdea748b2e6</id>
<content type='text'>
Add a SpecMcastGroup class to the nlspec lib.

Signed-off-by: Donald Hunter &lt;donald.hunter@gmail.com&gt;
Reviewed-by: Jacob Keller &lt;jacob.e.keller@intel.com&gt;
Link: https://lore.kernel.org/r/20230825122756.7603-6-donald.hunter@gmail.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
</feed>
