Linux-kernel mailing list archive 2000-26,: [patch-2.4.0-test3-pre2] bugfix for init_pipe_fs()

# [patch-2.4.0-test3-pre2] bugfix for init_pipe_fs()

Tigran Aivazian (tigran@veritas.com)
Fri, 30 Jun 2000 17:53:14 +0100 (BST)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Larry McVoy: "Re: a joint letter on low latency and Linux"
- Previous message: yodaiken@fsmlabs.com: "Re: a joint letter on low latency and Linux"

Hi Linus,

In fs/pipe.c:init_pipe_fs(), if kern_mount() fails (e.g. because
kmalloc() failed in add_vfsmnt()) then the module is not loaded but the
filesystem is left registered. So, "cat /proc/filesystems" would Oops
because of type->name referring to module's address space.

Of course, I do understand that _today_ none of this can happen because
pipefs cannot really be compiled as a module but it is written in a way
suggesting that in the future it will be (i.e. it has a valid
module_exit() procedure, unlike, say bdflush_init() which is put
inside module_init() just for nicety) and so this is a valid bugfix, I
think.

Regards,
Tigran

--- fs/pipe.c.0 Fri Jun 30 17:45:21 2000
+++ fs/pipe.c Fri Jun 30 17:47:06 2000
@@ -633,7 +633,9 @@
if (!err) {
pipe_mnt = kern_mount(&pipe_fs_type);
err = PTR_ERR(pipe_mnt);
- if (!IS_ERR(pipe_mnt))
+ if (IS_ERR(pipe_mnt))
+ unregister_filesystem(&pipe_fs_type);
+ else
err = 0;
}
return err;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

- Next message: Larry McVoy: "Re: a joint letter on low latency and Linux"
- Previous message: yodaiken@fsmlabs.com: "Re: a joint letter on low latency and Linux"