# 4.9.16: nftables memory leak

## seVes

Hi,

I recognized a memory leak on my remote machine with 4.9.16 which i didn't had with 4.4.6.

From time to time, the execution time of the command nft list table ip filter is rising.

Doesn't matter if i have static rules or some sets, where i block ip's (dynamically added).

With my laptop, running 4.9.16 all seems fine.

```
real   0m0.010s

user   0m0.000s

sys   0m0.003s
```

```
real   0m0.310s

user   0m0.000s

sys   0m0.103s
```

The time of my laptop is between 0.008 - 0.019, running nftables for 32 days now.

At my remote machine, the time is rising every minute, starting from 0.015 and reaching 0.310 after approx 6 hours.

A day later, i'm on 0.500. Another day 0.800....

A few days later, i didn't get any response from nft anymore.

RAM is heavily increased than. (22GB / 32GB used, 12GB more than normal)

```
Apr 16 13:39:17 localhost kernel: ------------[ cut here ]------------

Apr 16 13:39:17 localhost kernel: WARNING: CPU: 0 PID: 325 at net/sched/sch_generic.c:316 dev_watchdog+0x215/0x220

Apr 16 13:39:17 localhost kernel: NETDEV WATCHDOG: eth0 (r8169): transmit queue 0 timed out

Apr 16 13:39:17 localhost kernel: Modules linked in: fuse

Apr 16 13:39:17 localhost kernel: CPU: 0 PID: 325 Comm: kworker/0:1 Not tainted 4.9.16-gentoo #5

Apr 16 13:39:17 localhost kernel: Hardware name: MSI MS-7816/H87-G43 (MS-7816), BIOS V2.14B6 08/23/2013

Apr 16 13:39:17 localhost kernel: Workqueue: events rht_deferred_worker

Apr 16 13:39:17 localhost kernel: 0000000000000000 ffffffff81320b5d ffff88081ea03e70 0000000000000000

Apr 16 13:39:17 localhost kernel: ffffffff8111eb2a 0000000000000000 ffff88081ea03ec0 ffff8807faa0a000

Apr 16 13:39:17 localhost kernel: 0000000000000000 0000000000000001 ffff8807f9d2d880 ffffffff8111eb9a

Apr 16 13:39:17 localhost kernel: Call Trace:

Apr 16 13:39:17 localhost kernel: <IRQ> 

Apr 16 13:39:17 localhost kernel: [<ffffffff81320b5d>] ? dump_stack+0x46/0x59

Apr 16 13:39:17 localhost kernel: [<ffffffff8111eb2a>] ? __warn+0xba/0xe0

Apr 16 13:39:17 localhost kernel: [<ffffffff8111eb9a>] ? warn_slowpath_fmt+0x4a/0x50

Apr 16 13:39:17 localhost kernel: [<ffffffff815a49d5>] ? dev_watchdog+0x215/0x220

Apr 16 13:39:17 localhost kernel: [<ffffffff815a47c0>] ? dev_graft_qdisc+0x70/0x70

Apr 16 13:39:17 localhost kernel: [<ffffffff815a47c0>] ? dev_graft_qdisc+0x70/0x70

Apr 16 13:39:17 localhost kernel: [<ffffffff81166581>] ? call_timer_fn.isra.26+0x11/0x70

Apr 16 13:39:17 localhost kernel: [<ffffffff8116666e>] ? expire_timers+0x8e/0xa0

Apr 16 13:39:17 localhost kernel: [<ffffffff8116678a>] ? run_timer_softirq+0x6a/0xb0

Apr 16 13:39:17 localhost kernel: [<ffffffff811670e4>] ? __hrtimer_run_queues+0xc4/0x150

Apr 16 13:39:17 localhost kernel: [<ffffffff8116b7e1>] ? ktime_get+0x31/0xa0

Apr 16 13:39:17 localhost kernel: [<ffffffff811720e5>] ? clockevents_program_event+0x65/0x100

Apr 16 13:39:17 localhost kernel: [<ffffffff81122313>] ? __do_softirq+0xd3/0x1c0

Apr 16 13:39:17 localhost kernel: [<ffffffff816c90ec>] ? do_softirq_own_stack+0x1c/0x30

Apr 16 13:39:17 localhost kernel: <EOI> 

Apr 16 13:39:17 localhost kernel: [<ffffffff811220ca>] ? do_softirq.part.15+0x2a/0x30

Apr 16 13:39:17 localhost kernel: [<ffffffff81122160>] ? __local_bh_enable_ip+0x90/0xa0

Apr 16 13:39:17 localhost kernel: [<ffffffff813379ea>] ? rht_deferred_worker+0x2ea/0x3d0

Apr 16 13:39:17 localhost kernel: [<ffffffff811326c8>] ? process_one_work+0x128/0x300

Apr 16 13:39:17 localhost kernel: [<ffffffff811328e5>] ? worker_thread+0x45/0x460

Apr 16 13:39:17 localhost kernel: [<ffffffff811328a0>] ? process_one_work+0x300/0x300

Apr 16 13:39:17 localhost kernel: [<ffffffff811328a0>] ? process_one_work+0x300/0x300

Apr 16 13:39:17 localhost kernel: [<ffffffff8112f86b>] ? call_usermodehelper_exec_async+0x11b/0x130

Apr 16 13:39:17 localhost kernel: [<ffffffff81137579>] ? kthread+0xb9/0xd0

Apr 16 13:39:17 localhost kernel: [<ffffffff811374c0>] ? kthread_park+0x50/0x50

Apr 16 13:39:17 localhost kernel: [<ffffffff816c7ec2>] ? ret_from_fork+0x22/0x30

Apr 16 13:39:17 localhost kernel: ---[ end trace cc2d61f72785e3bf ]---

Apr 16 13:39:18 localhost kernel: r8169 0000:02:00.0 eth0: link up

Apr 16 13:44:38 localhost kernel: r8169 0000:02:00.0 eth0: link up

```

----------

## seVes

Some updates, see above.

----------

