Toshiaki Makita
7797b93b75
veth: Free queues on link delete
David Ahern reported memory leak in veth.
=======================================================================
$ cat /sys/kernel/debug/kmemleak
unreferenced object 0xffff8800354d5c00 (size 1024):
comm "ip", pid 836, jiffies 4294722952 (age 25.904s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<(____ptrval____)>] kmemleak_alloc+0x70/0x94
[<(____ptrval____)>] slab_post_alloc_hook+0x42/0x52
[<(____ptrval____)>] __kmalloc+0x101/0x142
[<(____ptrval____)>] kmalloc_array.constprop.20+0x1e/0x26 [veth]
[<(____ptrval____)>] veth_newlink+0x147/0x3ac [veth]
...
unreferenced object 0xffff88002e009c00 (size 1024):
comm "ip", pid 836, jiffies 4294722958 (age 25.898s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<(____ptrval____)>] kmemleak_alloc+0x70/0x94
[<(____ptrval____)>] slab_post_alloc_hook+0x42/0x52
[<(____ptrval____)>] __kmalloc+0x101/0x142
[<(____ptrval____)>] kmalloc_array.constprop.20+0x1e/0x26 [veth]
[<(____ptrval____)>] veth_newlink+0x219/0x3ac [veth]
=======================================================================
veth_rq allocated in veth_newlink() was not freed on dellink.
We need to free up them after veth_close() so that any packets will not
reference the queues afterwards. Thus free them in veth_dev_free() in
the same way as freeing stats structure (vstats).
Also move queues allocation to veth_dev_init() to be in line with stats
allocation.
Fixes: 638264dc90 ("veth: Support per queue XDP ring")
Reported-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Reviewed-by: David Ahern <dsahern@gmail.com>
Tested-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-08-16 12:22:31 -07:00
..
2018-08-14 16:39:13 -07:00
2018-06-06 13:49:25 -07:00
2018-06-12 16:19:22 -07:00
2018-08-15 22:06:26 -07:00
2018-07-03 10:29:26 +09:00
2018-08-01 18:58:09 +02:00
2018-08-15 15:04:25 -07:00
2018-07-18 09:34:19 +02:00
2018-08-15 15:04:25 -07:00
2018-08-13 15:59:39 +02:00
2018-07-02 04:24:44 -07:00
2018-08-02 15:22:39 -06:00
2018-08-15 22:51:12 -07:00
2018-08-15 21:41:21 -07:00
2018-08-13 18:28:19 -07:00
2018-07-08 11:00:50 +09:00
2018-08-06 10:22:27 +02:00
2018-06-25 09:33:34 +02:00
2018-08-15 16:01:47 -07:00
2018-07-13 10:54:01 -07:00
2018-07-18 13:58:39 +09:00
2018-08-09 14:47:05 +01:00
2018-07-16 20:20:37 +05:30
2018-07-25 11:17:15 +02:00
2018-06-12 16:19:22 -07:00
2018-06-12 16:19:22 -07:00
2018-08-15 18:29:14 -07:00
2018-06-12 16:19:22 -07:00
2018-07-07 16:55:22 +02:00
2018-08-15 21:35:38 -07:00
2018-08-15 17:39:07 -07:00
2018-07-09 17:16:11 -07:00
2018-06-12 16:19:22 -07:00
2018-08-15 15:04:25 -07:00
2018-06-11 12:09:19 -07:00
2018-06-12 16:19:22 -07:00
2018-08-14 11:51:03 -07:00
2018-08-02 15:22:37 -06:00
2018-06-24 14:50:52 +01:00
2018-08-16 09:21:54 -07:00
2018-08-13 09:50:24 -07:00
2018-07-27 19:01:06 +02:00
2018-06-12 16:19:22 -07:00
2018-08-06 12:45:42 +02:00
2018-07-26 21:23:47 -07:00
2018-08-06 23:03:12 +02:00
2018-07-18 08:44:20 -06:00
2018-06-07 10:23:33 -07:00
2018-08-15 09:53:07 +05:30
2018-08-14 11:03:16 -07:00
2018-08-15 18:29:14 -07:00
2018-07-31 09:46:06 +02:00
2018-06-12 16:19:22 -07:00
2018-07-30 23:17:53 -04:00
2018-06-14 16:21:46 +09:00
2018-08-16 09:21:54 -07:00
2018-08-09 14:47:05 +01:00
2018-08-14 14:10:30 -07:00
2018-08-16 12:22:31 -07:00
2018-06-25 21:36:45 +08:00
2018-06-29 20:16:44 -05:00
2018-07-23 15:07:12 +02:00
2018-08-05 19:32:09 -06:00
2018-08-14 10:23:25 -07:00
2018-07-07 17:30:25 +02:00
2018-08-15 15:04:25 -07:00
2018-06-19 15:53:32 +05:30
2018-06-12 16:19:22 -07:00
2018-06-04 10:58:12 -07:00
2018-06-15 18:10:01 -03:00
2018-08-16 09:21:54 -07:00
2018-06-12 16:19:22 -07:00
2018-07-27 14:39:04 +01:00
2018-06-29 12:00:22 +05:30
2018-08-14 12:31:27 -07:00
2018-08-16 09:21:54 -07:00
2018-06-07 12:34:37 -07:00
2018-06-12 16:19:22 -07:00
2018-07-02 13:00:24 +02:00
2018-08-06 10:43:35 -07:00
2018-06-14 16:25:43 +09:00
2018-06-12 16:19:22 -07:00
2018-08-10 17:31:24 +01:00
2018-06-15 07:55:25 +09:00
2018-06-12 18:28:00 -07:00
2018-06-04 12:35:03 -07:00
2018-07-13 10:37:54 +02:00
2018-08-15 15:04:25 -07:00
2018-06-15 18:10:01 -03:00
2018-08-15 22:06:26 -07:00
2018-08-02 13:54:06 +02:00
2018-06-12 16:19:22 -07:00
2018-08-14 13:12:24 -07:00
2018-06-15 18:11:26 -03:00
2018-08-10 17:51:52 +01:00
2018-08-09 18:47:47 +03:00
2018-08-15 18:29:14 -07:00
2018-08-15 22:06:26 -07:00
2018-06-22 12:58:08 +10:00
2018-08-16 10:21:18 -07:00
2018-07-07 17:29:17 +02:00
2018-08-15 10:46:54 -07:00
2018-07-07 16:57:35 +02:00
2018-08-15 22:06:26 -07:00
2018-06-12 16:19:22 -07:00
2018-08-16 09:21:54 -07:00
2018-08-15 22:06:26 -07:00
2018-08-15 18:29:14 -07:00
2018-06-12 16:19:22 -07:00
2018-08-11 12:02:18 -07:00
2018-06-26 09:46:27 +02:00
2018-06-12 12:56:02 -07:00
2018-08-15 22:06:26 -07:00
2018-06-06 17:27:14 -07:00
2018-08-02 15:19:48 -06:00