public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Qian Cai <cai@lca.pw>
To: Tejun Heo <tj@kernel.org>
Cc: Marcin Pawlowski <mpawlowski@fb.com>,
	"Williams, Gerald S" <gerald.s.williams@intel.com>,
	linux-kernel@vger.kernel.org,
	Lai Jiangshan <jiangshanlai@gmail.com>
Subject: "Fix spurious sanity check failures in destroy_workqueue()" introduced memory leaks
Date: Fri, 20 Sep 2019 16:26:00 -0400	[thread overview]
Message-ID: <1569011160.5576.205.camel@lca.pw> (raw)

The linux-next commit [1] introduced a lot of memory leaks while running LTP fs
tests (/opt/ltp/runltp -f fs). Reverted the commit fixed the problem. It seems
the new code wq->rescuer to NULL without free it first, so later rcu_free_wq()
is unable to free it.

unreferenced object 0xffff8f822e7c8428 (size 192):
  comm "fs_fill", pid 8310, jiffies 4294965449 (age 494.720s)
  hex dump (first 32 bytes):
    28 84 7c 2e 82 8f ff ff 28 84 7c 2e 82 8f ff ff  (.|.....(.|.....
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<0000000030795d2f>] kmem_cache_alloc_node_trace+0x153/0x470
    [<000000000398512e>] alloc_worker+0x21/0x50
    [<000000001934cb3a>] init_rescuer.part.4+0x1d/0xb0
    [<00000000f36417e5>] alloc_workqueue+0x336/0x5f3
    [<0000000011066bf3>] ext4_fill_super+0x1eec/0x2f70 [ext4]
    [<000000001fdee6fd>] mount_bdev+0x191/0x1c0
    [<00000000e2d3e265>] ext4_mount+0x15/0x20 [ext4]
    [<00000000631fe1d9>] legacy_get_tree+0x34/0x60
    [<00000000ee947c38>] vfs_get_tree+0x27/0xb0
    [<00000000f4bcb594>] do_mount+0x8a0/0xae0
    [<0000000005dd5056>] ksys_mount+0xb6/0xd0
    [<00000000fb14e10a>] __x64_sys_mount+0x25/0x30
    [<000000009fb1dd3e>] do_syscall_64+0x6d/0x488
    [<00000000a822a6c4>] entry_SYSCALL_64_after_hwframe+0x49/0xbe
unreferenced object 0xffff8f824c314218 (size 192):
  comm "fs_fill", pid 8310, jiffies 4294966011 (age 489.100s)
  hex dump (first 32 bytes):
    18 42 31 4c 82 8f ff ff 18 42 31 4c 82 8f ff ff  .B1L.....B1L....
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<0000000030795d2f>] kmem_cache_alloc_node_trace+0x153/0x470
    [<000000000398512e>] alloc_worker+0x21/0x50
    [<000000001934cb3a>] init_rescuer.part.4+0x1d/0xb0
    [<00000000f36417e5>] alloc_workqueue+0x336/0x5f3
    [<000000000b6d2e88>] xfs_init_mount_workqueues+0x2a/0x150 [xfs]
    [<0000000014c756cd>] xfs_fs_fill_super+0x311/0x760 [xfs]
    [<000000001fdee6fd>] mount_bdev+0x191/0x1c0
    [<00000000d0aa6706>] xfs_fs_mount+0x15/0x20 [xfs]
    [<00000000631fe1d9>] legacy_get_tree+0x34/0x60
    [<00000000ee947c38>] vfs_get_tree+0x27/0xb0
    [<00000000f4bcb594>] do_mount+0x8a0/0xae0
    [<0000000005dd5056>] ksys_mount+0xb6/0xd0
    [<00000000fb14e10a>] __x64_sys_mount+0x25/0x30
    [<000000009fb1dd3e>] do_syscall_64+0x6d/0x488
    [<00000000a822a6c4>] entry_SYSCALL_64_after_hwframe+0x49/0xbe

[1] https://lore.kernel.org/lkml/20190919014340.GM3084169@devbig004.ftw2.faceboo
k.com/

             reply	other threads:[~2019-09-20 20:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-20 20:26 Qian Cai [this message]
2019-09-20 20:43 ` [PATCH wq/for-5.4-fixes] workqueue: Fix missing kfree(rescuer) in destroy_workqueue() Tejun Heo

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=1569011160.5576.205.camel@lca.pw \
    --to=cai@lca.pw \
    --cc=gerald.s.williams@intel.com \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpawlowski@fb.com \
    --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