Skip to contentSkip to conversation

VFS: memory leak in do_kern_mount()

PATCH In review Gerald Schaefer 2 participants 3 messages Jun 17, 2005 VFS

lore
Share & tools
lore
#0 lore raw

cover VFS: memory leak in do_kern_mount()

[PATCH 0/1] VFS: memory leak in do_kern_mount()
There is a memory leak during mount when CONFIG_SECURITY is enabled and mount options are specified.

---

fs/super.c 2005-06-17 14:18:06.000000000 +0200 renamed from fs/super.c 2005-06-16 20:00:26.000000000 +0200 +1 -0
diff -pruN linux-2.6-git/fs/super.c linux-2.6-git_xxx/fs/super.c
@@ -835,6 +835,7 @@ do_kern_mount(const char *fstype, int fl
        mnt->mnt_parent = mnt;
        mnt->mnt_namespace = current->namespace;
        up_write(&sb->s_umount);
+       free_secdata(secdata);
        put_filesystem(type);
        return mnt;
 out_sb:
#1 lore raw
Quoted 11 lines · Gerald Schaefer

[PATCH 0/1] VFS: memory leak in do_kern_mount()
There is a memory leak during mount when CONFIG_SECURITY is enabled and mount options are specified.

---

diff -pruN linux-2.6-git/fs/super.c linux-2.6-git_xxx/fs/super.c

fs/super.c 2005-06-17 14:18:06.000000000 +0200 do_kern_mount(const char *fstype, int fl · line 841

Quoted 7 lines
fs/super.c 2005-06-17 14:18:06.000000000 +0200 renamed from fs/super.c 2005-06-16 20:00:26.000000000 +0200 +1 -0
@@ -835,6 +835,7 @@ do_kern_mount(const char *fstype, int fl
        mnt->mnt_parent = mnt;
        mnt->mnt_namespace = current->namespace;
        up_write(&sb->s_umount);
+       free_secdata(secdata);
        put_filesystem(type);
        return mnt;
 out_sb:

Sorry, there was a whitespace accident and the above patch would not apply. Here is the fixed version:

fs/super.c +1 -0
diff -pruN linux-2.6-git/fs/super.c linux-2.6-git_xxx/fs/super.c
@@ -835,6 +835,7 @@ do_kern_mount(const char *fstype, int fl
 	mnt->mnt_parent = mnt;
 	mnt->mnt_namespace = current->namespace;
 	up_write(&sb->s_umount);
+	free_secdata(secdata);
 	put_filesystem(type);
 	return mnt;
 out_sb:
Acked-by
#2 lore raw
Quoted 7 lines · Gerald Schaefer

Sorry, there was a whitespace accident and the above patch would not apply. Here is the fixed version:

diff -pruN linux-2.6-git/fs/super.c linux-2.6-git_xxx/fs/super.c

fs/super.c do_kern_mount(const char *fstype, int fl · line 841

Quoted 7 lines
fs/super.c +1 -0
@@ -835,6 +835,7 @@ do_kern_mount(const char *fstype, int fl
 	mnt->mnt_parent = mnt;
 	mnt->mnt_namespace = current->namespace;
 	up_write(&sb->s_umount);
+	free_secdata(secdata);
 	put_filesystem(type);
 	return mnt;
 out_sb:

- James

Signature · 2 lines
James Morris
<[email protected]>