From: Pablo Neira Ayuso <pablo@netfilter.org> Date: 2021-07-23 15:54:32
Hi,
The following patchset contains Netfilter fixes for net:
1) Memleak in commit audit error path, from Dongliang Mu.
2) Avoid possible false sharing for flowtable timeout updates
and nft_last use.
3) Adjust conntrack timestamp due to garbage collection delay,
from Florian Westphal.
4) Fix nft_nat without layer 3 address for the inet family.
5) Fix compilation warning in nfnl_hook when ingress support
is disabled, from Arnd Bergmann.
Please, pull these changes from:
git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git
Thanks.
----------------------------------------------------------------
The following changes since commit 5f119ba1d5771bbf46d57cff7417dcd84d3084ba:
net: decnet: Fix sleeping inside in af_decnet (2021-07-16 14:06:16 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git HEAD
for you to fetch changes up to 217e26bd87b2930856726b48a4e71c768b8c9bf5:
netfilter: nfnl_hook: fix unused variable warning (2021-07-23 14:45:03 +0200)
----------------------------------------------------------------
Arnd Bergmann (1):
netfilter: nfnl_hook: fix unused variable warning
Dongliang Mu (1):
netfilter: nf_tables: fix audit memory leak in nf_tables_commit
Florian Westphal (1):
netfilter: conntrack: adjust stop timestamp to real expiry value
Pablo Neira Ayuso (3):
netfilter: flowtable: avoid possible false sharing
netfilter: nft_last: avoid possible false sharing
netfilter: nft_nat: allow to specify layer 4 protocol NAT only
net/netfilter/nf_conntrack_core.c | 7 ++++++-
net/netfilter/nf_flow_table_core.c | 6 +++++-
net/netfilter/nf_tables_api.c | 12 ++++++++++++
net/netfilter/nfnetlink_hook.c | 2 ++
net/netfilter/nft_last.c | 20 +++++++++++++-------
net/netfilter/nft_nat.c | 4 +++-
6 files changed, 41 insertions(+), 10 deletions(-)
From: Pablo Neira Ayuso <pablo@netfilter.org> Date: 2021-07-23 15:54:51
From: Dongliang Mu <redacted>
In nf_tables_commit, if nf_tables_commit_audit_alloc fails, it does not
free the adp variable.
Fix this by adding nf_tables_commit_audit_free which frees
the linked list with the head node adl.
backtrace:
kmalloc include/linux/slab.h:591 [inline]
kzalloc include/linux/slab.h:721 [inline]
nf_tables_commit_audit_alloc net/netfilter/nf_tables_api.c:8439 [inline]
nf_tables_commit+0x16e/0x1760 net/netfilter/nf_tables_api.c:8508
nfnetlink_rcv_batch+0x512/0xa80 net/netfilter/nfnetlink.c:562
nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:634 [inline]
nfnetlink_rcv+0x1fa/0x220 net/netfilter/nfnetlink.c:652
netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline]
netlink_unicast+0x2c7/0x3e0 net/netlink/af_netlink.c:1340
netlink_sendmsg+0x36b/0x6b0 net/netlink/af_netlink.c:1929
sock_sendmsg_nosec net/socket.c:702 [inline]
sock_sendmsg+0x56/0x80 net/socket.c:722
Reported-by: syzbot <redacted>
Reported-by: kernel test robot <redacted>
Fixes: c520292f29b8 ("audit: log nftables configuration change events once per table")
Signed-off-by: Dongliang Mu <redacted>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
net/netfilter/nf_tables_api.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
From: Pablo Neira Ayuso <pablo@netfilter.org> Date: 2021-07-23 15:54:51
From: Arnd Bergmann <arnd@arndb.de>
The only user of this variable is in an #ifdef:
net/netfilter/nfnetlink_hook.c: In function 'nfnl_hook_entries_head':
net/netfilter/nfnetlink_hook.c:177:28: error: unused variable 'netdev' [-Werror=unused-variable]
Fixes: e2cf17d3774c ("netfilter: add new hook nfnl subsystem")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
net/netfilter/nfnetlink_hook.c | 2 ++
1 file changed, 2 insertions(+)
From: Pablo Neira Ayuso <pablo@netfilter.org> Date: 2021-07-23 15:54:52
The flowtable follows the same timeout approach as conntrack, use the
same idiom as in cc16921351d8 ("netfilter: conntrack: avoid same-timeout
update") but also include the fix provided by e37542ba111f ("netfilter:
conntrack: avoid possible false sharing").
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
net/netfilter/nf_flow_table_core.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
From: Pablo Neira Ayuso <pablo@netfilter.org> Date: 2021-07-23 15:54:53
From: Florian Westphal <fw@strlen.de>
In case the entry is evicted via garbage collection there is
delay between the timeout value and the eviction event.
This adjusts the stop value based on how much time has passed.
Fixes: b87a2f9199ea82 ("netfilter: conntrack: add gc worker to remove timed-out entries")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
net/netfilter/nf_conntrack_core.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
Hello:
This series was applied to netdev/net.git (refs/heads/master):
On Fri, 23 Jul 2021 17:54:07 +0200 you wrote:
From: Dongliang Mu <redacted>
In nf_tables_commit, if nf_tables_commit_audit_alloc fails, it does not
free the adp variable.
Fix this by adding nf_tables_commit_audit_free which frees
the linked list with the head node adl.
[...]