Al Viro
186c5856dc
cachefiles: fix the race between cachefiles_bury_object() and rmdir(2)
...
commit 169b803397 upstream.
the victim might've been rmdir'ed just before the lock_rename();
unlike the normal callers, we do not look the source up after the
parents are locked - we know it beforehand and just recheck that it's
still the child of what used to be its parent. Unfortunately,
the check is too weak - we don't spot a dead directory since its
->d_parent is unchanged, dentry is positive, etc. So we sail all
the way to ->rename(), with hosting filesystems _not_ expecting
to be asked renaming an rmdir'ed subdirectory.
The fix is easy, fortunately - the lock on parent is sufficient for
making IS_DEADDIR() on child safe.
Cc: stable@vger.kernel.org
Fixes: 9ae326a690 (CacheFiles: A cache that backs onto a mounted filesystem)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
Signed-off-by: David Howells <dhowells@redhat.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2018-11-10 07:43:00 -08:00
..
2018-09-09 20:01:20 +02:00
2016-10-10 20:16:43 -07:00
2018-05-30 07:50:16 +02:00
2017-12-20 10:07:25 +01:00
2018-09-19 22:47:16 +02:00
2016-10-15 12:09:13 -07:00
2016-10-10 23:02:51 -04:00
2018-11-10 07:42:53 -08:00
2018-11-10 07:43:00 -08:00
2018-08-24 13:12:33 +02:00
2018-11-10 07:42:54 -08:00
2017-11-24 08:33:42 +01:00
2018-09-26 08:36:38 +02:00
2016-05-09 11:41:14 -04:00
2018-08-03 07:55:20 +02:00
2017-08-06 18:59:43 -07:00
2016-10-10 20:16:43 -07:00
2017-09-09 17:39:40 +02:00
2018-05-30 07:50:16 +02:00
2016-10-10 20:16:43 -07:00
2016-05-20 17:58:30 -07:00
2016-10-27 18:43:43 -07:00
2016-10-06 09:07:44 -04:00
2018-05-30 07:50:16 +02:00
2018-10-20 09:51:32 +02:00
2018-11-10 07:42:45 -08:00
2018-11-10 07:42:56 -08:00
2016-06-13 10:20:39 +02:00
2018-09-05 09:20:02 +02:00
2018-09-05 09:20:08 +02:00
2018-09-26 08:36:32 +02:00
2018-09-15 09:42:57 +02:00
2018-09-15 09:42:57 +02:00
2016-10-10 20:16:43 -07:00
2016-10-10 20:16:43 -07:00
2017-10-08 10:26:09 +02:00
2017-11-30 08:39:04 +00:00
2018-07-11 16:26:44 +02:00
2018-05-30 07:50:22 +02:00
2018-08-09 12:18:00 +02:00
2018-02-17 13:21:15 +01:00
2018-05-19 10:27:00 +02:00
2016-10-10 20:16:43 -07:00
2016-10-10 20:16:43 -07:00
2018-03-28 18:39:23 +02:00
2018-09-26 08:36:37 +02:00
2018-02-03 17:05:38 +01:00
2018-10-03 17:01:48 -07:00
2018-05-30 07:50:16 +02:00
2018-04-24 09:34:18 +02:00
2016-10-30 13:09:42 -04:00
2018-11-10 07:42:51 -08:00
2016-10-10 20:16:43 -07:00
2016-09-27 21:06:21 -04:00
2018-11-10 07:42:46 -08:00
2018-04-13 19:48:12 +02:00
2018-10-20 09:51:32 +02:00
2018-09-26 08:36:35 +02:00
2016-05-09 11:41:14 -04:00
2016-05-09 11:41:14 -04:00
2018-09-09 20:01:26 +02:00
2016-10-10 20:16:43 -07:00
2018-09-15 09:42:57 +02:00
2017-06-17 06:41:56 +02:00
2018-09-05 09:20:03 +02:00
2018-09-05 09:20:10 +02:00
2016-10-10 20:16:43 -07:00
2016-09-27 21:06:21 -04:00
2018-10-13 09:18:58 +02:00
2018-07-03 11:23:17 +02:00
2018-11-10 07:42:49 -08:00
2018-11-10 07:43:00 -08:00
2018-06-06 16:44:38 +02:00
2016-10-10 20:16:43 -07:00
2017-01-09 08:32:24 +01:00
2016-05-28 16:34:59 -07:00
2016-07-25 16:51:49 +10:00
2018-09-26 08:36:37 +02:00
2016-08-02 19:35:15 -04:00
2016-07-28 13:29:12 +10:00
2018-06-26 08:08:09 +08:00
2014-12-13 12:42:51 -08:00
2017-10-18 09:35:39 +02:00
2017-06-14 15:06:00 +02:00
2016-08-23 22:58:51 -07:00
2018-02-25 11:05:55 +01:00
2018-04-08 12:12:44 +02:00
2016-09-27 21:20:53 -04:00
2017-07-05 14:40:26 +02:00
2018-02-28 10:18:33 +01:00
2018-09-15 09:42:58 +02:00
2017-10-18 09:35:41 +02:00
2015-08-17 18:39:46 -04:00
2016-03-22 15:36:02 -07:00
2017-09-07 08:35:41 +02:00
2018-07-28 07:49:14 +02:00
2018-01-31 12:55:52 +01:00
2016-03-22 15:36:02 -07:00
2015-08-07 04:39:40 +03:00
2016-09-27 18:47:38 -04:00
2016-01-19 12:02:23 -05:00
2015-04-09 11:39:55 -05:00
2018-05-16 10:08:42 +02:00
2018-07-17 11:37:53 +02:00
2017-09-20 08:20:01 +02:00
2016-09-15 13:29:52 -07:00
2017-09-20 08:19:59 +02:00
2016-10-07 18:46:29 -07:00
2016-08-12 16:47:05 +01:00
2017-12-09 22:01:51 +01:00
2016-10-18 12:21:28 +02:00
2016-06-21 09:23:11 +10:00
2018-02-22 15:43:48 +01:00
2017-07-21 07:42:22 +02:00
2017-10-18 09:35:39 +02:00
2018-04-20 08:21:07 +02:00
2018-08-15 18:14:43 +02:00
2018-02-17 13:21:15 +01:00
2017-07-12 15:01:02 +02:00
2018-02-17 13:21:18 +01:00
2017-07-21 07:42:22 +02:00
2017-03-15 10:02:43 +08:00
2017-01-26 08:24:37 +01:00
2016-03-16 13:09:08 -04:00
2017-10-12 11:51:26 +02:00
2016-05-26 00:13:25 -04:00
2016-10-11 15:06:30 -07:00
2016-10-07 18:46:30 -07:00
2015-08-07 04:39:40 +03:00
2017-02-23 17:44:35 +01:00
2017-06-14 15:06:01 +02:00
2018-03-03 10:23:21 +01:00
2016-04-04 10:41:08 -07:00
2017-05-08 07:47:54 +02:00
2017-12-20 10:07:18 +01:00
2016-10-08 11:06:08 -04:00
2018-10-10 08:53:22 +02:00