<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/net/netfilter/nft_socket.c, branch v6.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.3</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2022-11-15T09:46:34Z</updated>
<entry>
<title>netfilter: nf_tables: Extend nft_expr_ops::dump callback parameters</title>
<updated>2022-11-15T09:46:34Z</updated>
<author>
<name>Phil Sutter</name>
<email>phil@nwl.cc</email>
</author>
<published>2022-10-14T21:45:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7d34aa3e03b6a56306296bd98b26c6a1710cd57b'/>
<id>urn:sha1:7d34aa3e03b6a56306296bd98b26c6a1710cd57b</id>
<content type='text'>
Add a 'reset' flag just like with nft_object_ops::dump. This will be
useful to reset "anonymous stateful objects", e.g. simple rule counters.

No functional change intended.

Signed-off-by: Phil Sutter &lt;phil@nwl.cc&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>cgroup: Replace cgroup-&gt;ancestor_ids[] with -&gt;ancestors[]</title>
<updated>2022-08-15T21:16:47Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2022-07-29T23:10:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7f203bc89eb66d6afde7eae91347fc0352090cc3'/>
<id>urn:sha1:7f203bc89eb66d6afde7eae91347fc0352090cc3</id>
<content type='text'>
Every cgroup knows all its ancestors through its -&gt;ancestor_ids[]. There's
no advantage to remembering the IDs instead of the pointers directly and
this makes the array useless for finding an actual ancestor cgroup forcing
cgroup_ancestor() to iteratively walk up the hierarchy instead. Let's
replace cgroup-&gt;ancestor_ids[] with -&gt;ancestors[] and remove the walking-up
from cgroup_ancestor().

While at it, improve comments around cgroup_root-&gt;cgrp_ancestor_storage.

This patch shouldn't cause user-visible behavior differences.

v2: Update cgroup_ancestor() to use -&gt;ancestors[].

v3: cgroup_root-&gt;cgrp_ancestor_storage's type is updated to match
    cgroup-&gt;ancestors[]. Better comments.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
</content>
</entry>
<entry>
<title>netfilter: nf_tables: use the correct get/put helpers</title>
<updated>2022-07-11T14:40:46Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2022-06-23T13:05:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d86473bf2ff39c05d4a6701c8aec66a16af0d410'/>
<id>urn:sha1:d86473bf2ff39c05d4a6701c8aec66a16af0d410</id>
<content type='text'>
Switch to be16/32 and u16/32 respectively.  No code changes here,
the functions do the same thing, this is just for sparse checkers' sake.

objdiff shows no changes.

Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: nft_socket: only do sk lookups when indev is available</title>
<updated>2022-04-28T14:15:23Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2022-04-28T07:39:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=743b83f15d4069ea57c3e40996bf4a1077e0cdc1'/>
<id>urn:sha1:743b83f15d4069ea57c3e40996bf4a1077e0cdc1</id>
<content type='text'>
Check if the incoming interface is available and NFT_BREAK
in case neither skb-&gt;sk nor input device are set.

Because nf_sk_lookup_slow*() assume packet headers are in the
'in' direction, use in postrouting is not going to yield a meaningful
result.  Same is true for the forward chain, so restrict the use
to prerouting, input and output.

Use in output work if a socket is already attached to the skb.

Fixes: 554ced0a6e29 ("netfilter: nf_tables: add support for native socket matching")
Reported-and-tested-by: Topi Miettinen &lt;toiwoton@gmail.com&gt;
Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: nft_socket: make cgroup match work in input too</title>
<updated>2022-04-11T10:12:46Z</updated>
<author>
<name>Florian Westphal</name>
<email>fw@strlen.de</email>
</author>
<published>2022-04-09T11:20:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=05ae2fba821c4d122ab4ba3e52144e21586c4010'/>
<id>urn:sha1:05ae2fba821c4d122ab4ba3e52144e21586c4010</id>
<content type='text'>
cgroupv2 helper function ignores the already-looked up sk
and uses skb-&gt;sk instead.

Just pass sk from the calling function instead; this will
make cgroup matching work for udp and tcp in input even when
edemux did not set skb-&gt;sk already.

Fixes: e0bb96db96f8 ("netfilter: nft_socket: add support for cgroupsv2")
Signed-off-by: Florian Westphal &lt;fw@strlen.de&gt;
Tested-by: Topi Miettinen &lt;toiwoton@gmail.com&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: nft_socket: track register operations</title>
<updated>2022-03-19T23:29:47Z</updated>
<author>
<name>Pablo Neira Ayuso</name>
<email>pablo@netfilter.org</email>
</author>
<published>2022-03-14T17:23:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d77a721d212d48e2ff62334e00cc4cfcad751ff5'/>
<id>urn:sha1:d77a721d212d48e2ff62334e00cc4cfcad751ff5</id>
<content type='text'>
Check if the destination register already contains the data that this
socket expression performs. This allows to skip this redundant
operation.  If the destination contains a different selector, update the
register tracking information.

Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: nft_socket: fix build with CONFIG_SOCK_CGROUP_DATA=n</title>
<updated>2021-04-27T20:34:05Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2021-04-27T19:45:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7acc0bb490c85012bcbda142b6755fd1fdf1fba1'/>
<id>urn:sha1:7acc0bb490c85012bcbda142b6755fd1fdf1fba1</id>
<content type='text'>
In some configurations, the sock_cgroup_ptr() function is not available:

net/netfilter/nft_socket.c: In function 'nft_sock_get_eval_cgroupv2':
net/netfilter/nft_socket.c:47:16: error: implicit declaration of function 'sock_cgroup_ptr'; did you mean 'obj_cgroup_put'? [-Werror=implicit-function-declaration]
   47 |         cgrp = sock_cgroup_ptr(&amp;sk-&gt;sk_cgrp_data);
      |                ^~~~~~~~~~~~~~~
      |                obj_cgroup_put
net/netfilter/nft_socket.c:47:14: error: assignment to 'struct cgroup *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
   47 |         cgrp = sock_cgroup_ptr(&amp;sk-&gt;sk_cgrp_data);
      |              ^

Change the caller to match the same #ifdef check, only calling it
when the function is defined.

Fixes: e0bb96db96f8 ("netfilter: nft_socket: add support for cgroupsv2")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: nft_socket: fix an unused variable warning</title>
<updated>2021-04-27T20:34:00Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2021-04-27T19:45:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8a7363f8497900e33d4ac391315e8a8d53a03d89'/>
<id>urn:sha1:8a7363f8497900e33d4ac391315e8a8d53a03d89</id>
<content type='text'>
The variable is only used in an #ifdef, causing a harmless warning:

net/netfilter/nft_socket.c: In function 'nft_socket_init':
net/netfilter/nft_socket.c:137:27: error: unused variable 'level' [-Werror=unused-variable]
  137 |         unsigned int len, level;
      |                           ^~~~~

Move it into the same #ifdef block.

Fixes: e0bb96db96f8 ("netfilter: nft_socket: add support for cgroupsv2")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: nft_socket: add support for cgroupsv2</title>
<updated>2021-04-26T01:20:07Z</updated>
<author>
<name>Pablo Neira Ayuso</name>
<email>pablo@netfilter.org</email>
</author>
<published>2021-04-20T23:12:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e0bb96db96f8ca94349344a2ea7bebc6f8cefdae'/>
<id>urn:sha1:e0bb96db96f8ca94349344a2ea7bebc6f8cefdae</id>
<content type='text'>
Allow to match on the cgroupsv2 id from ancestor level.

Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
<entry>
<title>netfilter: nftables: add nft_parse_register_store() and use it</title>
<updated>2021-01-27T22:16:02Z</updated>
<author>
<name>Pablo Neira Ayuso</name>
<email>pablo@netfilter.org</email>
</author>
<published>2021-01-25T17:27:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=345023b0db315648ccc3c1a36aee88304a8b4d91'/>
<id>urn:sha1:345023b0db315648ccc3c1a36aee88304a8b4d91</id>
<content type='text'>
This new function combines the netlink register attribute parser
and the store validation function.

This update requires to replace:

        enum nft_registers      dreg:8;

in many of the expression private areas otherwise compiler complains
with:

        error: cannot take address of bit-field ‘dreg’

when passing the register field as reference.

Signed-off-by: Pablo Neira Ayuso &lt;pablo@netfilter.org&gt;
</content>
</entry>
</feed>
