RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1483543 - quotacheck tool leaks memory when scanning ext file system directly
Summary: quotacheck tool leaks memory when scanning ext file system directly
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: quota
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Petr Pisar
QA Contact: Robin Hack
URL: https://sourceforge.net/p/linuxquota/...
Whiteboard:
Depends On:
Blocks: 1465904
TreeView+ depends on / blocked
 
Reported: 2017-08-21 11:26 UTC by Petr Pisar
Modified: 2018-04-10 08:43 UTC (History)
2 users (show)

Fixed In Version: quota-4.01-16.el7
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
Environment:
Last Closed: 2018-04-10 08:42:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Proposed fix (3.82 KB, patch)
2017-08-21 11:38 UTC, Petr Pisar
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1393849 1 None None None 2021-01-20 06:05:38 UTC
Red Hat Product Errata RHEA-2018:0667 0 None None None 2018-04-10 08:43:09 UTC

Internal Links: 1393849

Description Petr Pisar 2017-08-21 11:26:57 UTC
Since quota-4.01-15.el7.x86_64, quotacheck tool uses direct scanning for ext4 file system. There are some memory leaks in the direct scanning feature:

# dd if=/dev/zero of=disk.img bs=1M count=40
# mkfs.ext4 -F disk.img
# mount -o loop,jqfmt=vfsv1,usrjquota=aquota.user disk.img /mnt/1
# valgrind --leak-check=yes quotacheck -f /mnt/1/
==8864== Memcheck, a memory error detector
==8864== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==8864== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==8864== Command: quotacheck -f /mnt/1/
==8864== 
==8864== 
==8864== HEAP SUMMARY:
==8864==     in use at exit: 25,099 bytes in 30 blocks
==8864==   total heap usage: 227 allocs, 197 frees, 72,131 bytes allocated
==8864== 
==8864== 1,392 (88 direct, 1,304 indirect) bytes in 1 blocks are definitely lost in loss record 19 of 23
==8864==    at 0x4C29BE3: malloc (vg_replace_malloc.c:299)
==8864==    by 0x4E5288B: ext2fs_make_generic_bitmap (in /usr/lib64/libext2fs.so.2.4)
==8864==    by 0x4E47ED5: ext2fs_allocate_inode_bitmap (in /usr/lib64/libext2fs.so.2.4)
==8864==    by 0x10DC36: ??? (in /usr/sbin/quotacheck)
==8864==    by 0x10B095: ??? (in /usr/sbin/quotacheck)
==8864==    by 0x52A0C04: (below main) (in /usr/lib64/libc-2.17.so)
==8864== 
==8864== 8,464 (144 direct, 8,320 indirect) bytes in 1 blocks are definitely lost in loss record 22 of 23
==8864==    at 0x4C29BE3: malloc (vg_replace_malloc.c:299)
==8864==    by 0x4E5749D: ext2fs_open_inode_scan (in /usr/lib64/libext2fs.so.2.4)
==8864==    by 0x10DC5F: ??? (in /usr/sbin/quotacheck)
==8864==    by 0x10B095: ??? (in /usr/sbin/quotacheck)
==8864==    by 0x52A0C04: (below main) (in /usr/lib64/libc-2.17.so)
==8864== 
==8864== 15,243 (88 direct, 15,155 indirect) bytes in 1 blocks are definitely lost in loss record 23 of 23
==8864==    at 0x4C29BE3: malloc (vg_replace_malloc.c:299)
==8864==    by 0x4E5288B: ext2fs_make_generic_bitmap (in /usr/lib64/libext2fs.so.2.4)
==8864==    by 0x4E47ED5: ext2fs_allocate_inode_bitmap (in /usr/lib64/libext2fs.so.2.4)
==8864==    by 0x10DC08: ??? (in /usr/sbin/quotacheck)
==8864==    by 0x10B095: ??? (in /usr/sbin/quotacheck)
==8864==    by 0x52A0C04: (below main) (in /usr/lib64/libc-2.17.so)
==8864== 
==8864== LEAK SUMMARY:
==8864==    definitely lost: 320 bytes in 3 blocks
==8864==    indirectly lost: 24,779 bytes in 27 blocks
==8864==      possibly lost: 0 bytes in 0 blocks
==8864==    still reachable: 0 bytes in 0 blocks
==8864==         suppressed: 0 bytes in 0 blocks
==8864== 
==8864== For counts of detected and suppressed errors, rerun with: -v
==8864== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0)

The same applies to ext2 and ext3 file systems. This is not a new bug, it just became more prominent as former quota packages did not use direct scanning on ext4.

Comment 2 Petr Pisar 2017-08-21 11:38:19 UTC
Created attachment 1316222 [details]
Proposed fix

Comment 8 errata-xmlrpc 2018-04-10 08:42:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2018:0667


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