Bug 172892 - kernel dm: dm-ioctl memory leak on attempt to load non-existing mapping
Summary: kernel dm: dm-ioctl memory leak on attempt to load non-existing mapping
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel
Version: 4.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Alasdair Kergon
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks: 168429
TreeView+ depends on / blocked
 
Reported: 2005-11-10 21:19 UTC by David Milburn
Modified: 2007-11-30 22:07 UTC (History)
2 users (show)

Fixed In Version: RHSA-2006-0132
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-03-07 20:40:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2005:808 0 normal SHIPPED_LIVE Important: kernel security update 2005-10-27 04:00:00 UTC
Red Hat Product Errata RHSA-2006:0132 0 qe-ready SHIPPED_LIVE Moderate: Updated kernel packages available for Red Hat Enterprise Linux 4 Update 3 2006-03-09 16:31:00 UTC

Description David Milburn 2005-11-10 21:19:05 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.0.7-1.1.fc3 Firefox/1.0.7

Description of problem:
Customer found memory leak occurred when "dmsetup load" is executed for non-existing mapping.

Version-Release number of selected component (if applicable):
kernel-2.6.9-22.EL

How reproducible:
Always

Steps to Reproduce:
1. Run the dmsetup load command for non-existing map like below.
   # dmsetup remove foo
   # dd if=/dev/zero of=a bs=1M count=1
   # losetup /dev/loop7 a
   # while true; do echo "0 10 linear 7:7 0" | \
     dmsetup load foo >& /dev/null; done

2. Check the memory usage and the /var/log/messages.
  

Actual Results:  Memory usage will increase (about 3MB/s on my machine).
On IA-32, vmalloc area will soon become short (within about 1 minute)
and the following message will appear in the /var/log/messages:
--------------------------------------------------------------------
Nov  9 13:33:31 nec-em2 kernel: device-mapper: device doesn't appear to be in the dev hash table.
Nov  9 13:34:02 nec-em2 last message repeated 10360 times
Nov  9 13:34:10 nec-em2 kernel: allocation failed: out of vmalloc space - use vmalloc=<size> to increase size.
--------------------------------------------------------------------


Expected Results:  Memory shouldn't be leaked.


Additional info:

The following patch fixes this problem and it has been posted
to the upstream, accepted by Alasdair.

https://www.redhat.com/archives/dm-devel/2005-November/msg00066.html

Comment 1 Alasdair Kergon 2005-11-14 18:08:38 UTC
An error path in table_load() forgets to release a table that won't
now be referenced.


Comment 2 Alasdair Kergon 2005-11-14 18:11:48 UTC
dm-ioctl-missing-put-in-table-load-error-case.patch

Comment 8 Red Hat Bugzilla 2006-03-07 20:40:14 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2006-0132.html



Note You need to log in before you can comment on or make changes to this bug.