Bug 395851 - kernel: Fix a memory leak in alloc_disk_node()
kernel: Fix a memory leak in alloc_disk_node()
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
All Linux
low Severity high
: ---
: ---
Assigned To: Red Hat Product Security
reported=20071122, public=20071122, i...
: Security
Depends On: 395861 395871 435891 435892
  Show dependency treegraph
Reported: 2007-11-22 11:43 EST by Jan Lieskovsky
Modified: 2016-03-04 06:09 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-12-22 11:35:31 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jan Lieskovsky 2007-11-22 11:43:22 EST
Description of problem:
Don't forget to free 'dkstats' when the allocation of 'part' failed. 

This issue public via: 


This one has not assigned the CVE name yet. Will update the bug report, as soon
as this CVE name will be assigned.
Comment 1 Jan Lieskovsky 2007-11-22 11:44:33 EST
Patch from the reporter: 

 genhd.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/block/genhd.c b/block/genhd.c
index e609996..f2ac914 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -715,6 +715,7 @@ struct gendisk *alloc_disk_node(int minors, int node_id)
                        disk->part = kmalloc_node(size,
                                GFP_KERNEL | __GFP_ZERO, node_id);
                        if (!disk->part) {
+                               free_disk_stats(disk);
                                return NULL;
Comment 9 Jan Lieskovsky 2008-03-13 06:34:11 EDT
Have closed clones BZ#395861 and BZ#435891 due the following reason:

After further investigation it has been discovered,
it would be hard to prove, the normal, unprivileged user could by his
"legal" resources gain access to the unfreed disk_stats structure.
More probably normal bug than a security issue (but still worthy to fix
in current kernel update releases).
Comment 10 Vincent Danen 2010-12-22 11:35:31 EST
This was addressed via:

RHEL5: http://rhn.redhat.com/errata/RHBA-2008-0314.html
RHEL4: http://rhn.redhat.com/errata/RHSA-2008-0665.html

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