<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/linux/netlink.h, 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>2024-10-17T13:24:29+00:00</updated>
<entry>
<title>rtnetlink: add RTNL_FLAG_DUMP_UNLOCKED flag</title>
<updated>2024-10-17T13:24:29+00:00</updated>
<author>
<name>Eric Dumazet</name>
<email>edumazet@google.com</email>
</author>
<published>2024-02-22T10:50:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ba5366b87c0dc3b15463495598737e28015559cd'/>
<id>urn:sha1:ba5366b87c0dc3b15463495598737e28015559cd</id>
<content type='text'>
[ Upstream commit 386520e0ecc01004d3a29c70c5a77d4bbf8a8420 ]

Similarly to RTNL_FLAG_DOIT_UNLOCKED, this new flag
allows dump operations registered via rtnl_register()
or rtnl_register_module() to opt-out from RTNL protection.

Signed-off-by: Eric Dumazet &lt;edumazet@google.com&gt;
Reviewed-by: Donald Hunter &lt;donald.hunter@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Stable-dep-of: 5be2062e3080 ("mpls: Handle error of rtnl_register_module().")
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>netlink: Add new netlink_release function</title>
<updated>2023-07-23T10:34:22+00:00</updated>
<author>
<name>Anjali Kulkarni</name>
<email>anjali.k.kulkarni@oracle.com</email>
</author>
<published>2023-07-19T20:18:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a4c9a56e6a2cdeeab7caef1f496b7bfefd95b50e'/>
<id>urn:sha1:a4c9a56e6a2cdeeab7caef1f496b7bfefd95b50e</id>
<content type='text'>
A new function netlink_release is added in netlink_sock to store the
protocol's release function. This is called when the socket is deleted.
This can be supplied by the protocol via the release function in
netlink_kernel_cfg. This is being added for the NETLINK_CONNECTOR
protocol, so it can free it's data when socket is deleted.

Signed-off-by: Anjali Kulkarni &lt;anjali.k.kulkarni@oracle.com&gt;
Reviewed-by: Liam R. Howlett &lt;Liam.Howlett@oracle.com&gt;
Acked-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>netlink: Reverse the patch which removed filtering</title>
<updated>2023-07-23T10:34:22+00:00</updated>
<author>
<name>Anjali Kulkarni</name>
<email>anjali.k.kulkarni@oracle.com</email>
</author>
<published>2023-07-19T20:18:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a3377386b56420d78a4c0a931a40f9a25c3ca2bd'/>
<id>urn:sha1:a3377386b56420d78a4c0a931a40f9a25c3ca2bd</id>
<content type='text'>
To use filtering at the connector &amp; cn_proc layers, we need to enable
filtering in the netlink layer. This reverses the patch which removed
netlink filtering - commit ID for that patch:
549017aa1bb7 (netlink: remove netlink_broadcast_filtered).

Signed-off-by: Anjali Kulkarni &lt;anjali.k.kulkarni@oracle.com&gt;
Reviewed-by: Liam R. Howlett &lt;Liam.Howlett@oracle.com&gt;
Acked-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>netlink: support extack in dump -&gt;start()</title>
<updated>2023-06-12T10:32:44+00:00</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2023-06-09T21:53:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5ab8c41cef30d8b6160a80b69d2eb39d570491ac'/>
<id>urn:sha1:5ab8c41cef30d8b6160a80b69d2eb39d570491ac</id>
<content type='text'>
Commit 4a19edb60d02 ("netlink: Pass extack to dump handlers")
added extack support to netlink dumps. It was focused on rtnl
and since rtnl does not use -&gt;start(), -&gt;done() callbacks
it ignored those. Genetlink on the other hand uses -&gt;start()
extensively, for parsing and input validation.

Pass the extact in via struct netlink_dump_control and link
it to cb for the time of -&gt;start(). Both struct netlink_dump_control
and extack itself live on the stack so we can't keep the same
extack for the duration of the dump. This means that the extack
visible in -&gt;start() and each -&gt;dump() callbacks will be different.
Corner cases like reporting a warning message in DONE across dump
calls are still not supported.

We could put the extack (for dumps) in the socket struct,
but layering makes it slightly awkward (extack pointer is decided
before the DO / DUMP split).

The genetlink dump error extacks are now surfaced:

  $ cli.py --spec netlink/specs/ethtool.yaml --dump channels-get
  lib.ynl.NlError: Netlink error: Invalid argument
  nl_len = 64 (48) nl_flags = 0x300 nl_type = 2
	error: -22	extack: {'msg': 'request header missing'}

Previously extack was missing:

  $ cli.py --spec netlink/specs/ethtool.yaml --dump channels-get
  lib.ynl.NlError: Netlink error: Invalid argument
  nl_len = 36 (20) nl_flags = 0x100 nl_type = 2
	error: -22

Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>netlink: Add a macro to set policy message with format string</title>
<updated>2023-03-28T02:49:58+00:00</updated>
<author>
<name>Shay Agroskin</name>
<email>shayagr@amazon.com</email>
</author>
<published>2023-03-23T16:36:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3e4d5ba9a3f85f21f1ebdee5a5901bb43389abc5'/>
<id>urn:sha1:3e4d5ba9a3f85f21f1ebdee5a5901bb43389abc5</id>
<content type='text'>
Similar to NL_SET_ERR_MSG_FMT, add a macro which sets netlink policy
error message with a format string.

Signed-off-by: Shay Agroskin &lt;shayagr@amazon.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>netlink: remove unused 'compare' function</title>
<updated>2023-03-10T07:11:09+00:00</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2023-03-08T14:20:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6978052448f9eb19f7b03243ac0416104e5ee50d'/>
<id>urn:sha1:6978052448f9eb19f7b03243ac0416104e5ee50d</id>
<content type='text'>
No users in the tree.  Tested with allmodconfig build.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Link: https://lore.kernel.org/r/20230308142006.20879-1-fw@strlen.de
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>netlink: provide an ability to set default extack message</title>
<updated>2023-02-02T05:04:09+00:00</updated>
<author>
<name>Leon Romanovsky</name>
<email>leonro@nvidia.com</email>
</author>
<published>2023-01-31T13:31:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=028fb19c6ba743ed308ba99ac325afa968795e0f'/>
<id>urn:sha1:028fb19c6ba743ed308ba99ac325afa968795e0f</id>
<content type='text'>
In netdev common pattern, extack pointer is forwarded to the drivers
to be filled with error message. However, the caller can easily
overwrite the filled message.

Instead of adding multiple "if (!extack-&gt;_msg)" checks before any
NL_SET_ERR_MSG() call, which appears after call to the driver, let's
add new macro to common code.

[1] https://lore.kernel.org/all/Y9Irgrgf3uxOjwUm@unreal
Reviewed-by: Simon Horman &lt;simon.horman@corigine.com&gt;
Reviewed-by: Nikolay Aleksandrov &lt;razor@blackwall.org&gt;
Signed-off-by: Leon Romanovsky &lt;leonro@nvidia.com&gt;
Link: https://lore.kernel.org/r/6993fac557a40a1973dfa0095107c3d03d40bec1.1675171790.git.leon@kernel.org
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>netlink: fix spelling mistake in dump size assert</title>
<updated>2023-01-25T00:29:11+00:00</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2023-01-23T22:22:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ec8f7d495b3d37c5f0d66cdc7e43ef76939293b6'/>
<id>urn:sha1:ec8f7d495b3d37c5f0d66cdc7e43ef76939293b6</id>
<content type='text'>
Commit 2c7bc10d0f7b ("netlink: add macro for checking dump ctx size")
misspelled the name of the assert as asset, missing an R.

Reported-by: Ido Schimmel &lt;idosch@idosch.org&gt;
Reviewed-by: Ido Schimmel &lt;idosch@nvidia.com&gt;
Link: https://lore.kernel.org/r/20230123222224.732338-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>netlink: add macro for checking dump ctx size</title>
<updated>2023-01-06T06:13:39+00:00</updated>
<author>
<name>Jakub Kicinski</name>
<email>kuba@kernel.org</email>
</author>
<published>2023-01-05T04:05:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2c7bc10d0f7b0f66d9042ed88bb3ecd588352a00'/>
<id>urn:sha1:2c7bc10d0f7b0f66d9042ed88bb3ecd588352a00</id>
<content type='text'>
We encourage casting struct netlink_callback::ctx to a local
struct (in a comment above the field). Provide a convenience
macro for checking if the local struct fits into the ctx.

Reviewed-by: Jacob Keller &lt;jacob.e.keller@intel.com&gt;
Reviewed-by: Jiri Pirko &lt;jiri@nvidia.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>netlink: add support for formatted extack messages</title>
<updated>2022-10-19T20:00:04+00:00</updated>
<author>
<name>Edward Cree</name>
<email>ecree.xilinx@gmail.com</email>
</author>
<published>2022-10-18T14:37:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=51c352bdbcd23d7ce46b06c1e64c82754dc44044'/>
<id>urn:sha1:51c352bdbcd23d7ce46b06c1e64c82754dc44044</id>
<content type='text'>
Include an 80-byte buffer in struct netlink_ext_ack that can be used
 for scnprintf()ed messages.  This does mean that the resulting string
 can't be enumerated, translated etc. in the way NL_SET_ERR_MSG() was
 designed to allow.

Signed-off-by: Edward Cree &lt;ecree.xilinx@gmail.com&gt;
Reviewed-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
</feed>
