Markus Armbruster
b32a09db4f
add match_strlcpy() us it to make v9fs make uname and remotename parsing more robust
...
match_strcpy() is a somewhat creepy function: the caller needs to make sure
that the destination buffer is big enough, and when he screws up or
forgets, match_strcpy() happily overruns the buffer.
There's exactly one customer: v9fs_parse_options(). I believe it currently
can't overflow its buffer, but that's not exactly obvious.
The source string is a substing of the mount options. The kernel silently
truncates those to PAGE_SIZE bytes, including the terminating zero. See
compat_sys_mount() and do_mount().
The destination buffer is obtained from __getname(), which allocates from
name_cachep, which is initialized by vfs_caches_init() for size PATH_MAX.
We're safe as long as PATH_MAX <= PAGE_SIZE. PATH_MAX is 4096. As far as
I know, the smallest PAGE_SIZE is also 4096.
Here's a patch that makes the code a bit more obviously correct. It
doesn't depend on PATH_MAX <= PAGE_SIZE.
Signed-off-by: Markus Armbruster <armbru@redhat.com >
Cc: Latchesar Ionkov <lucho@ionkov.net >
Cc: Jim Meyering <meyering@redhat.com >
Cc: "Randy.Dunlap" <rdunlap@xenotime.net >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com >
2008-05-14 19:23:25 -05:00
..
2008-04-30 08:29:54 -07:00
2008-05-01 18:59:11 +01:00
2008-05-08 01:15:21 -07:00
2008-04-30 08:29:33 -07:00
2008-04-29 08:06:27 -07:00
2008-05-14 10:00:26 -07:00
2008-04-30 08:29:54 -07:00
2008-05-01 13:08:50 -04:00
2008-04-30 08:29:50 -07:00
2008-05-13 08:02:25 -07:00
2008-04-29 08:11:16 -07:00
2008-04-29 12:36:54 -07:00
2008-04-30 08:29:54 -07:00
2008-05-01 08:03:59 -07:00
2008-04-30 08:29:54 -07:00
2008-05-01 08:03:59 -07:00
2008-04-30 08:42:49 -07:00
2008-05-10 19:51:16 -07:00
2008-04-30 08:29:54 -07:00
2008-04-30 08:29:54 -07:00
2008-04-30 08:29:52 -07:00
2008-05-13 08:02:25 -07:00
2008-04-30 08:29:54 -07:00
2008-04-30 08:29:54 -07:00
2008-04-30 08:29:53 -07:00
2008-04-30 08:29:54 -07:00
2008-05-14 10:37:58 -07:00
2008-04-30 08:29:48 -07:00
2008-04-29 08:06:26 -07:00
2008-04-29 08:06:16 -07:00
2008-04-30 08:29:54 -07:00
2008-05-07 09:48:23 +02:00
2008-05-01 13:08:16 -04:00
2008-05-01 13:08:16 -04:00
2008-05-07 09:29:00 +02:00
2008-04-30 08:29:54 -07:00
2008-04-30 08:29:54 -07:00
2008-05-13 08:02:26 -07:00
2008-04-30 08:29:45 -07:00
2008-05-14 10:37:57 -07:00
2008-05-10 20:58:02 -07:00
2008-05-03 18:11:48 +02:00
2008-04-30 08:29:54 -07:00
2008-05-11 20:37:06 +02:00
2008-04-30 08:29:54 -07:00
2008-04-29 08:06:25 -07:00
2008-04-30 20:34:26 -04:00
2008-05-02 16:53:33 -07:00
2008-04-30 08:29:54 -07:00
2008-04-30 08:29:54 -07:00
2008-05-01 13:08:16 -04:00
2008-05-05 16:47:14 +10:00
2008-05-07 09:51:23 +02:00
2008-04-29 08:06:15 -07:00
2008-04-29 08:06:15 -07:00
2008-05-02 13:40:34 +02:00
2008-04-30 08:29:54 -07:00
2008-05-01 08:03:58 -07:00
2008-05-02 21:50:44 +10:00
2008-04-29 08:06:29 -07:00
2008-04-30 08:29:53 -07:00
2008-04-29 08:06:17 -07:00
2008-04-29 08:06:16 -07:00
2008-04-30 08:29:54 -07:00
2008-05-05 07:13:21 -05:00
2008-04-30 16:52:58 -07:00
2008-04-30 08:29:54 -07:00
2008-04-30 08:29:54 -07:00
2008-04-30 08:29:54 -07:00
2008-05-09 15:00:55 -04:00
2008-04-30 08:29:54 -07:00
2008-05-01 08:03:58 -07:00
2008-05-13 08:02:25 -07:00
2008-04-29 08:06:17 -07:00
2008-04-30 08:29:54 -07:00
2008-05-01 21:14:59 +10:00
2008-04-30 08:29:54 -07:00
2008-04-29 09:11:12 -07:00
2008-04-29 08:06:24 -07:00
2008-04-30 08:29:54 -07:00
2008-05-12 20:48:31 -07:00
2008-04-30 08:29:54 -07:00
2008-05-09 20:22:58 +10:00
2008-05-14 19:23:25 -05:00
2008-05-01 08:04:01 -07:00
2008-04-29 15:34:05 -07:00
2008-05-03 03:39:55 +04:00
2008-05-06 12:01:41 -04:00
2008-04-30 08:29:49 -07:00
2008-04-30 08:29:49 -07:00
2008-04-30 08:29:54 -07:00
2008-04-30 11:52:52 -07:00
2008-04-30 08:29:53 -07:00
2008-05-01 13:07:28 -04:00
2008-04-29 08:06:20 -07:00
2008-04-30 08:29:54 -07:00
2008-04-30 08:29:50 -07:00
2008-04-30 08:29:38 -07:00
2008-05-01 08:04:01 -07:00
2008-04-30 08:29:54 -07:00
2008-05-10 19:51:16 -07:00
2008-04-30 08:29:54 -07:00
2008-04-30 08:29:54 -07:00
2008-04-30 08:29:51 -07:00
2008-04-30 08:29:54 -07:00
2008-05-03 10:01:33 -07:00
2008-04-30 08:29:54 -07:00
2008-05-12 13:34:13 -07:00
2008-04-29 08:06:16 -07:00
2008-04-30 08:29:54 -07:00
2008-04-30 08:29:30 -07:00
2008-04-30 08:29:34 -07:00
2008-04-30 08:29:54 -07:00
2008-04-30 08:29:54 -07:00
2008-04-30 08:29:54 -07:00
2008-05-01 08:03:59 -07:00
2008-04-30 08:29:54 -07:00
2008-04-29 08:06:23 -07:00
2008-05-04 17:07:03 -07:00
2008-04-29 08:06:27 -07:00
2008-04-30 08:29:54 -07:00
2008-04-30 08:29:37 -07:00
2008-04-30 08:29:53 -07:00
2008-05-01 08:03:59 -07:00
2008-04-30 08:29:47 -07:00
2008-04-30 08:29:47 -07:00
2008-05-09 07:45:18 -07:00
2008-05-02 21:50:51 +10:00
2008-05-02 21:50:50 +10:00
2008-05-02 21:50:47 +10:00
2008-05-02 21:50:50 +10:00
2008-05-01 17:38:35 -04:00
2008-04-30 08:29:49 -07:00