linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
To: linux-kernel@vger.kernel.org
Cc: "regressions@lists.linux.dev" <regressions@lists.linux.dev>,
	Tejun Heo <tj@kernel.org>, Florian Mickler <florian@mickler.org>,
	Thorsten Leemhuis <regressions@leemhuis.info>,
	systemd-devel@lists.freedesktop.org
Subject: Re: BUG: kworker + systemd-udevd memory leaks found in 6.1.0-rc4
Date: Thu, 10 Nov 2022 05:57:57 +0100	[thread overview]
Message-ID: <a6b76ce0-0fb3-4434-cc3e-ab6f39fb1cf9@alu.unizg.hr> (raw)
In-Reply-To: <0d9c3f6c-3948-d5d1-bcc1-baf31141beaa@alu.unizg.hr>

[-- Attachment #1: Type: text/plain, Size: 6231 bytes --]

On 04. 11. 2022. 11:40, Mirsad Goran Todorovac wrote:

> Dear Sirs,
>
> When building a RPM 6.1.0-rc3 for AlmaLinux 8.6, I have enabled 
> CONFIG_DEBUG_KMEMLEAK=y
> and the result showed an unreferenced object in kworker process:
>
> # cat /sys/kernel/debug/kmemleak
> unreferenced object 0xffffa01dabff6100 (size 16):
>   comm "kworker/u12:4", pid 400, jiffies 4294894771 (age 5284.956s)
>   hex dump (first 16 bytes):
>     6d 65 6d 73 74 69 63 6b 30 00 00 00 00 00 00 00 memstick0.......
>   backtrace:
>     [<000000009ff951f6>] __kmem_cache_alloc_node+0x380/0x4e0
>     [<00000000451f4268>] __kmalloc_node_track_caller+0x55/0x150
>     [<0000000005472512>] kstrdup+0x36/0x70
>     [<000000002f797ac4>] kstrdup_const+0x28/0x30
>     [<00000000e3f86581>] kvasprintf_const+0x78/0xa0
>     [<00000000e15920f7>] kobject_set_name_vargs+0x23/0xa0
>     [<000000004158a6c0>] dev_set_name+0x53/0x70
>     [<000000001a120541>] memstick_check+0xff/0x384 [memstick]
>     [<00000000122bb894>] process_one_work+0x214/0x3f0
>     [<00000000fcf282cc>] worker_thread+0x34/0x3d0
>     [<0000000002409855>] kthread+0xed/0x120
>     [<000000007b02b4a3>] ret_from_fork+0x1f/0x30
> unreferenced object 0xffffa01dabff6ec0 (size 16):
>   comm "kworker/u12:4", pid 400, jiffies 4294894774 (age 5284.944s)
>   hex dump (first 16 bytes):
>     6d 65 6d 73 74 69 63 6b 30 00 00 00 00 00 00 00 memstick0.......
>   backtrace:
>     [<000000009ff951f6>] __kmem_cache_alloc_node+0x380/0x4e0
>     [<00000000451f4268>] __kmalloc_node_track_caller+0x55/0x150
>     [<0000000005472512>] kstrdup+0x36/0x70
>     [<000000002f797ac4>] kstrdup_const+0x28/0x30
>     [<00000000e3f86581>] kvasprintf_const+0x78/0xa0
>     [<00000000e15920f7>] kobject_set_name_vargs+0x23/0xa0
>     [<000000004158a6c0>] dev_set_name+0x53/0x70
>     [<000000001a120541>] memstick_check+0xff/0x384 [memstick]
>     [<00000000122bb894>] process_one_work+0x214/0x3f0
>     [<00000000fcf282cc>] worker_thread+0x34/0x3d0
>     [<0000000002409855>] kthread+0xed/0x120
>     [<000000007b02b4a3>] ret_from_fork+0x1f/0x30
> #
>
> Please fing the build config and lshw output attached.
>
> dmesg is useless, as it is filled with events like:
>
> [ 6068.996120] evbug: Event. Dev: input4, Type: 1, Code: 31, Value: 0
> [ 6068.996121] evbug: Event. Dev: input4, Type: 0, Code: 0, Value: 0
> [ 6069.124145] evbug: Event. Dev: input4, Type: 4, Code: 4, Value: 458762
> [ 6069.124149] evbug: Event. Dev: input4, Type: 1, Code: 34, Value: 1
> [ 6069.124150] evbug: Event. Dev: input4, Type: 0, Code: 0, Value: 0
> [ 6069.196003] evbug: Event. Dev: input4, Type: 4, Code: 4, Value: 458762
> [ 6069.196007] evbug: Event. Dev: input4, Type: 1, Code: 34, Value: 0
> [ 6069.196009] evbug: Event. Dev: input4, Type: 0, Code: 0, Value: 0
> [ 6069.788129] evbug: Event. Dev: input4, Type: 4, Code: 4, Value: 458792
> [ 6069.788133] evbug: Event. Dev: input4, Type: 1, Code: 28, Value: 1
> [ 6069.788135] evbug: Event. Dev: input4, Type: 0, Code: 0, Value: 0

This bug is confirmed in 6.1-rc4, among the "thermald" and "systemd-dev" 
kernel memory leaks, potentially exposing race conditions or other more 
serious bug.

The bug is now also confirmed and now manifested also in the Ubuntu 
22.04 LTS jammy 6.1-rc4 build.

Here is the kmemleak output:

unreferenced object 0xffff9242b13b3980 (size 64):
   comm "kworker/5:3", pid 43106, jiffies 4305052439 (age 71828.792s)
   hex dump (first 32 bytes):
     80 8b a0 f0 42 92 ff ff 00 00 00 00 00 00 00 00 ....B...........
     20 86 a0 f0 42 92 ff ff 00 00 00 00 00 00 00 00 ...B...........
   backtrace:
     [<00000000c5dea4db>] __kmem_cache_alloc_node+0x380/0x4e0
     [<000000002b17af47>] kmalloc_node_trace+0x27/0xa0
     [<000000004c09eee5>] xhci_alloc_command+0x6e/0x180
     [<0000000099436a99>] xhci_alloc_command_with_ctx+0x1d/0x60
     [<0000000070f45e17>] xhci_change_max_exit_latency+0x2e/0x1c0
     [<000000001b13cf46>] xhci_disable_usb3_lpm_timeout+0x77/0xb0
     [<00000000ff561da4>] usb_disable_link_state+0x53/0xd0
     [<0000000068febd40>] usb_disable_lpm+0x82/0xc0
     [<00000000dffec01f>] usb_unlocked_disable_lpm+0x2d/0x50
     [<0000000061a59294>] usb_disable_device+0x12f/0x250
     [<0000000044e2299d>] usb_set_configuration+0x65c/0x9a0
     [<000000001af32470>] driver_set_config_work+0x78/0xa0
     [<00000000320216c3>] process_one_work+0x214/0x3f0
     [<00000000694e932f>] worker_thread+0x34/0x3d0
     [<0000000002e30775>] kthread+0xed/0x120
     [<00000000512e8066>] ret_from_fork+0x1f/0x30
unreferenced object 0xffff9242f0a08620 (size 32):
   comm "kworker/5:3", pid 43106, jiffies 4305052439 (age 71828.792s)
   hex dump (first 32 bytes):
     00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
     30 86 a0 f0 42 92 ff ff 30 86 a0 f0 42 92 ff ff 0...B...0...B...
   backtrace:
     [<00000000c5dea4db>] __kmem_cache_alloc_node+0x380/0x4e0
     [<000000002b17af47>] kmalloc_node_trace+0x27/0xa0
     [<00000000459908cf>] xhci_alloc_command+0xe6/0x180
     [<0000000099436a99>] xhci_alloc_command_with_ctx+0x1d/0x60
     [<0000000070f45e17>] xhci_change_max_exit_latency+0x2e/0x1c0
     [<000000001b13cf46>] xhci_disable_usb3_lpm_timeout+0x77/0xb0
     [<00000000ff561da4>] usb_disable_link_state+0x53/0xd0
     [<0000000068febd40>] usb_disable_lpm+0x82/0xc0
     [<00000000dffec01f>] usb_unlocked_disable_lpm+0x2d/0x50
     [<0000000061a59294>] usb_disable_device+0x12f/0x250
     [<0000000044e2299d>] usb_set_configuration+0x65c/0x9a0
     [<000000001af32470>] driver_set_config_work+0x78/0xa0
     [<00000000320216c3>] process_one_work+0x214/0x3f0
     [<00000000694e932f>] worker_thread+0x34/0x3d0
     [<0000000002e30775>] kthread+0xed/0x120
     [<00000000512e8066>] ret_from_fork+0x1f/0x30

Please find the complete kmemleak output attached:

Thanks,
Mirsad

--
Mirsad Goran Todorovac
Sistem inženjer
Grafički fakultet | Akademija likovnih umjetnosti
Sveučilište u Zagrebu
-- 
System engineer
Faculty of Graphic Arts | Academy of Fine Arts
University of Zagreb, Republic of Croatia
The European Union

[-- Attachment #2: thermald_systemd-dev_kworker.memleak.lrz --]
[-- Type: application/x-lrzip, Size: 2723 bytes --]

  reply	other threads:[~2022-11-10  4:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04 10:40 BUG: kworker memory leak found in 6.1.0-rc3 Mirsad Goran Todorovac
2022-11-10  4:57 ` Mirsad Goran Todorovac [this message]
2022-11-10  8:28   ` BUG: kworker + systemd-udevd memory leaks found in 6.1.0-rc4 Thorsten Leemhuis
2022-11-11  8:44     ` Mirsad Goran Todorovac
2022-11-11 10:09       ` Mirsad Goran Todorovac
2022-11-10  9:20   ` Greg KH
2022-11-17 15:34     ` Mirsad Goran Todorovac
2022-11-29  3:35     ` Mirsad Goran Todorovac
2022-11-29  8:36       ` Greg KH
2022-11-29  9:59         ` Mirsad Goran Todorovac

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a6b76ce0-0fb3-4434-cc3e-ab6f39fb1cf9@alu.unizg.hr \
    --to=mirsad.todorovac@alu.unizg.hr \
    --cc=florian@mickler.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=regressions@leemhuis.info \
    --cc=regressions@lists.linux.dev \
    --cc=systemd-devel@lists.freedesktop.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).