Skip to contentSkip to conversation

Leak in virtio_net in net-next

DISCUSSION Jens Axboe 1 participant 1 message May 9, 2024

Subsystems (2)
lore
Share & tools
lore

Jens Axboe

author
#0 lore raw

Hi,

Starting working on a small networking series this morning, and was instantly greeted by:

[   13.018662] kmemleak: 2 new suspected memory leaks (see /sys/kernel/debug/kmemleak)

when booting my vm image. Details:

# cat /sys/kernel/debug/kmemleak
unreferenced object 0xffff000006479aa0 (size 8):
  comm "kworker/3:1", pid 98, jiffies 4294892862
  hex dump (first 8 bytes):
    00 00 00 00 00 00 00 00                          ........
  backtrace (crc 0):
    [<00000000e3a8eaad>] kmemleak_alloc+0x30/0x38
    [<0000000067412f7a>] kmalloc_trace+0x234/0x364
    [<0000000077402ae2>] virtnet_rx_mode_work+0x144/0x78c
    [<00000000a7f96032>] process_one_work+0x538/0x1048
    [<000000002cbbcce6>] worker_thread+0x760/0xbd4
    [<0000000077f92d4a>] kthread+0x2dc/0x368
    [<0000000051ca839f>] ret_from_fork+0x10/0x20
unreferenced object 0xffff000006479ac0 (size 8):
  comm "kworker/3:1", pid 98, jiffies 4294892862
  hex dump (first 8 bytes):
    00 00 00 00 00 00 00 00                          ........
  backtrace (crc 0):
    [<00000000e3a8eaad>] kmemleak_alloc+0x30/0x38
    [<0000000067412f7a>] kmalloc_trace+0x234/0x364
    [<0000000077402ae2>] virtnet_rx_mode_work+0x144/0x78c
    [<00000000a7f96032>] process_one_work+0x538/0x1048
    [<000000002cbbcce6>] worker_thread+0x760/0xbd4
    [<0000000077f92d4a>] kthread+0x2dc/0x368
    [<0000000051ca839f>] ret_from_fork+0x10/0x20

and taking a quick look at the virtio_net commits that are in that tree, this one introduces the leaks:

commit ff7c7d9f5261e4372e541e6bb6781b386a839b48

Author: Daniel Jurgens <[email protected]>
Date:   Fri May 3 23:24:41 2024 +0300

virtio_net: Remove command data from control_buf

I didn't look into debugging this, figured if I can trigger this by just booting a vm in 10 seconds, it should be trivial for the authors/testers/reviewers to sort out.

Signature · 1 line
Jens Axboe