Al Viro
22213318af
fix races between __d_instantiate() and checks of dentry flags
...
in non-lazy walk we need to be careful about dentry switching from
negative to positive - both ->d_flags and ->d_inode are updated,
and in some places we might see only one store. The cases where
dentry has been obtained by dcache lookup with ->i_mutex held on
parent are safe - ->d_lock and ->i_mutex provide all the barriers
we need. However, there are several places where we run into
trouble:
* do_last() fetches ->d_inode, then checks ->d_flags and
assumes that inode won't be NULL unless d_is_negative() is true.
Race with e.g. creat() - we might have fetched the old value of
->d_inode (still NULL) and new value of ->d_flags (already not
DCACHE_MISS_TYPE). Lin Ming has observed and reported the resulting
oops.
* a bunch of places checks ->d_inode for being non-NULL,
then checks ->d_flags for "is it a symlink". Race with symlink(2)
in case if our CPU sees ->d_inode update first - we see non-NULL
there, but ->d_flags still contains DCACHE_MISS_TYPE instead of
DCACHE_SYMLINK_TYPE. Result: false negative on "should we follow
link here?", with subsequent unpleasantness.
Cc: stable@vger.kernel.org # 3.13 and 3.14 need that one
Reported-and-tested-by: Lin Ming <minggr@gmail.com >
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
2014-04-19 12:30:58 -04:00
..
2014-04-07 16:35:53 -07:00
2014-04-07 16:36:08 -07:00
2014-04-07 16:36:08 -07:00
2014-04-03 16:21:01 -07:00
2014-04-08 16:48:51 -07:00
2014-04-04 15:39:39 -07:00
2014-04-07 16:36:08 -07:00
2014-04-12 14:49:50 -07:00
2014-04-12 14:49:50 -07:00
2014-04-12 15:39:53 -07:00
2014-04-13 14:10:26 -07:00
2014-04-04 15:39:39 -07:00
2013-11-21 16:42:27 -08:00
2014-04-04 15:39:39 -07:00
2014-04-04 15:39:39 -07:00
2014-03-13 10:14:33 -04:00
2014-04-11 16:15:36 -04:00
2014-04-04 14:03:05 -07:00
2014-03-04 16:16:16 +00:00
2014-04-04 15:39:39 -07:00
2014-04-10 14:33:02 -07:00
2013-11-09 00:16:38 -05:00
2014-04-07 17:59:17 -07:00
2014-04-07 17:59:17 -07:00
2014-04-12 14:49:50 -07:00
2014-04-07 16:38:06 -07:00
2014-04-04 15:39:39 -07:00
2014-04-04 15:39:39 -07:00
2014-02-17 13:47:35 -08:00
2014-04-12 14:49:50 -07:00
2014-04-07 16:35:53 -07:00
2014-04-04 15:39:39 -07:00
2014-04-04 15:39:39 -07:00
2014-04-03 16:21:01 -07:00
2014-04-04 15:39:39 -07:00
2013-07-03 16:07:41 -07:00
2014-04-03 16:20:59 -07:00
2014-04-07 17:59:17 -07:00
2013-12-04 12:27:46 +01:00
2014-03-12 16:38:03 -04:00
2014-04-07 10:17:30 -07:00
2014-04-04 15:39:39 -07:00
2014-04-03 16:22:16 -07:00
2014-03-28 10:43:08 -04:00
2014-04-03 16:21:01 -07:00
2014-04-04 15:39:39 -07:00
2014-04-12 17:31:22 -07:00
2014-04-07 16:35:53 -07:00
2013-02-13 06:15:14 -08:00
2014-04-08 18:28:14 -07:00
2014-04-07 16:35:53 -07:00
2014-01-25 03:14:05 -05:00
2014-04-03 16:20:51 -07:00
2014-04-12 14:49:50 -07:00
2014-04-12 17:31:22 -07:00
2014-04-03 16:21:01 -07:00
2014-03-13 10:14:33 -04:00
2014-04-12 14:49:50 -07:00
2014-04-04 15:39:39 -07:00
2014-03-13 10:14:33 -04:00
2014-03-13 10:14:33 -04:00
2014-04-07 17:59:17 -07:00
2014-01-23 16:36:58 -08:00
2014-04-07 17:59:17 -07:00
2014-03-13 10:14:33 -04:00
2014-03-13 10:14:33 -04:00
2014-03-25 20:54:57 -07:00
2014-04-04 15:39:39 -07:00
2014-04-07 16:35:53 -07:00
2014-04-12 14:49:50 -07:00
2014-04-07 16:36:16 -07:00
2014-04-12 14:49:50 -07:00
2014-03-28 10:14:45 -04:00
2014-03-27 09:52:54 -07:00
2013-12-05 16:36:21 -06:00
2013-06-29 12:57:04 +04:00
2013-11-09 00:16:26 -05:00
2013-11-09 00:16:30 -05:00
2014-04-07 16:35:52 -07:00
2013-10-24 23:34:54 -04:00
2013-04-29 15:40:23 -04:00
2014-04-03 16:21:16 -07:00
2012-12-20 17:40:19 -08:00
2012-11-28 21:53:38 -05:00
2014-04-09 08:00:06 -06:00
2014-04-12 14:49:50 -07:00
2014-04-12 14:49:50 -07:00
2014-04-12 14:49:50 -07:00
2013-11-14 12:08:14 +09:00
2014-03-04 08:05:21 +00:00
2014-03-06 16:30:44 +01:00
2014-04-04 14:21:20 -07:00
2014-01-23 16:37:01 -08:00
2014-04-19 12:30:58 -04:00
2014-01-29 16:22:40 -08:00
2014-04-04 15:50:08 -07:00
2014-04-03 16:21:04 -07:00
2014-01-25 03:13:04 -05:00
2014-01-02 14:40:30 -08:00
2014-04-12 14:49:50 -07:00
2014-03-31 08:24:43 -04:00
2012-12-20 14:04:11 -08:00
2014-04-12 14:49:50 -07:00
2014-04-12 14:49:50 -07:00
2014-04-03 16:21:05 -07:00
2013-11-06 12:40:26 +01:00
2014-04-04 14:49:16 -07:00
2014-04-04 15:39:39 -07:00
2013-11-09 00:16:20 -05:00
2013-10-24 23:34:54 -04:00
2012-05-30 08:52:42 -07:00
2014-02-07 16:08:57 -08:00
2013-04-30 17:04:04 -07:00
2013-11-15 22:04:17 -05:00
2014-03-31 08:24:43 -04:00
2014-02-07 16:08:57 -08:00
2014-03-18 19:24:49 -04:00
2014-04-01 23:19:09 -04:00
2013-11-23 22:33:47 -08:00
2014-04-19 12:30:58 -04:00
2014-04-01 23:19:18 -04:00
2014-04-12 14:49:50 -07:00
2014-04-01 23:19:22 -04:00
2014-04-01 23:19:08 -04:00
2014-04-01 23:19:08 -04:00
2014-04-04 14:49:16 -07:00
2014-04-01 23:19:09 -04:00
2014-03-31 14:32:17 -07:00
2013-10-24 23:34:54 -04:00
2013-11-13 15:34:18 +09:00
2013-11-18 19:07:53 -08:00
2013-03-03 22:58:46 -05:00
2014-04-01 23:19:23 -04:00
2013-11-09 00:16:31 -05:00
2013-10-12 13:12:31 -07:00
2014-03-13 10:14:33 -04:00
2014-02-22 02:02:28 +01:00
2014-01-23 16:57:40 -08:00
2013-11-09 00:16:44 -05:00
2012-12-20 18:50:11 -05:00