OGAWA Hirofumi
928a477102
fat: fix fake_offset handling on error path
...
For the root directory, . and .. are faked (using dir_emit_dots()) and
ctx->pos is reset from 2 to 0.
A corrupted root directory could cause fat_get_entry() to fail, but
->iterate() (fat_readdir()) reports progress to the VFS (with ctx->pos
rewound to 0), so any following calls to ->iterate() continue to return
the same entries again and again.
The result is that userspace will never see the end of the directory,
causing e.g. 'ls' to hang in a getdents() loop.
[hirofumi@mail.parknet.co.jp: cleanup and make sure to correct fake_offset]
Reported-by: Vegard Nossum <vegard.nossum@oracle.com>
Tested-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Richard Weinberger <richard.weinberger@gmail.com>
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-11-20 16:17:32 -08:00
..
2015-11-13 18:02:30 -08:00
2015-06-30 19:44:57 -07:00
2015-09-10 13:29:01 -07:00
2015-05-11 10:50:17 -04:00
2015-06-23 18:02:01 -04:00
2015-07-04 19:36:06 -07:00
2015-04-26 17:22:07 -07:00
2015-11-13 16:30:29 -08:00
2015-11-16 20:38:43 -05:00
2015-11-13 09:24:40 -08:00
2015-11-13 16:40:36 -08:00
2015-09-10 13:29:01 -07:00
2015-11-20 16:17:32 -08:00
2015-11-11 02:04:44 -05:00
2015-06-30 19:44:58 -07:00
2015-11-13 20:04:17 -08:00
2015-11-07 13:05:44 -08:00
2015-05-06 10:57:37 -07:00
2015-06-25 17:00:42 -07:00
2015-11-09 15:11:24 -08:00
2015-11-13 18:02:30 -08:00
2015-11-13 18:02:30 -08:00
2015-11-13 18:02:30 -08:00
2015-11-20 16:17:32 -08:00
2015-08-07 13:59:24 +02:00
2015-11-11 02:11:02 -05:00
2015-10-22 14:57:36 -04:00
2015-11-13 18:02:30 -08:00
2015-09-10 13:29:01 -07:00
2015-11-13 20:34:32 -05:00
2015-09-04 16:54:41 -07:00
2015-11-09 15:11:24 -08:00
2015-11-20 16:17:32 -08:00
2015-04-15 15:06:57 -04:00
2015-11-07 14:32:45 -08:00
2015-11-13 20:34:32 -05:00
2015-11-09 15:11:24 -08:00
2015-08-18 15:49:15 -07:00
2015-11-11 20:11:28 -08:00
2015-11-06 17:50:42 -08:00
2015-07-04 19:36:06 -07:00
2015-11-20 16:17:32 -08:00
2015-11-13 18:02:30 -08:00
2015-08-13 10:22:06 -04:00
2015-11-10 09:29:45 -05:00
2015-11-11 09:45:24 -08:00
2015-11-05 19:34:48 -08:00
2015-11-06 17:50:42 -08:00
2015-11-13 20:04:17 -08:00
2015-05-28 18:25:19 -07:00
2015-10-31 14:49:19 -07:00
2015-11-07 14:32:45 -08:00
2015-11-02 13:41:52 -08:00
2015-06-23 18:02:00 -04:00
2015-09-05 20:34:28 -07:00
2015-10-16 11:42:28 -07:00
2015-11-13 18:02:30 -08:00
2015-04-11 22:29:40 -04:00
2015-11-13 20:34:33 -05:00
2015-11-13 21:53:18 -08:00
2015-06-23 18:02:00 -04:00
2015-11-04 22:13:45 -05:00
2015-11-13 18:02:30 -08:00
2015-08-20 14:58:35 +02:00
2015-09-09 10:43:12 -07:00
2015-11-13 18:02:30 -08:00
2015-09-04 16:54:41 -07:00
2015-11-10 12:07:22 -08:00
2015-11-11 09:45:24 -08:00
2015-04-26 17:22:07 -07:00
2015-11-11 09:36:57 -07:00
2015-11-11 02:19:33 -05:00
2015-08-05 13:49:35 -07:00
2015-10-23 23:26:43 +02:00
2015-11-06 17:50:42 -08:00
2015-11-13 17:35:48 -08:00
2015-08-21 02:34:37 -04:00
2015-11-10 17:23:49 -08:00
2015-08-17 18:39:46 -04:00
2015-07-10 10:39:25 -05:00
2015-06-02 10:29:07 -07:00
2015-08-07 04:39:40 +03:00
2015-11-05 23:05:32 -08:00
2015-04-09 11:39:55 -05:00
2015-11-11 02:18:27 -05:00
2015-11-11 02:18:27 -05:00
2015-08-17 23:38:10 -04:00
2015-07-23 20:59:40 +02:00
2015-04-14 16:49:05 -07:00
2015-08-12 15:28:45 -05:00
2015-10-22 14:57:42 -04:00
2015-10-15 10:33:21 -04:00
2015-06-30 19:44:56 -07:00
2015-11-06 17:50:42 -08:00
2015-11-07 14:32:45 -08:00
2015-09-01 16:13:25 -07:00
2015-09-11 15:21:34 -07:00
2015-07-10 10:39:25 -05:00
2015-11-11 02:18:26 -05:00
2015-04-02 20:34:20 -05:00
2015-07-22 20:33:27 -05:00
2015-11-13 20:34:32 -05:00
2015-06-30 19:44:56 -07:00
2015-04-11 22:29:46 -04:00
2015-05-19 08:32:00 +02:00
2015-11-06 17:50:42 -08:00
2015-08-07 04:39:40 +03:00
2015-11-06 17:50:42 -08:00
2015-11-09 15:11:24 -08:00
2015-08-21 02:31:20 -04:00
2015-11-06 17:50:42 -08:00
2015-09-22 15:09:53 -07:00
2015-11-13 20:34:33 -05:00