David Howells 3978d81652 afs: Add missing vnode validation checks
afs_d_revalidate() should only be validating the directory entry it is
given and the directory to which that belongs; it shouldn't be validating
the inode/vnode to which that dentry points.  Besides, validation need to
be done even if we don't call afs_d_revalidate() - which might be the case
if we're starting from a file descriptor.

In order for afs_d_revalidate() to be fixed, validation points must be
added in some other places.  Certain directory operations, such as
afs_unlink(), already check this, but not all and not all file operations
either.

Note that the validation of a vnode not only checks to see if the
attributes we have are correct, but also gets a promise from the server to
notify us if that file gets changed by a third party.

Add the following checks:

 - Check the vnode we're going to make a hard link to.
 - Check the vnode we're going to move/rename.
 - Check the vnode we're going to read from.
 - Check the vnode we're going to write to.
 - Check the vnode we're going to sync.
 - Check the vnode we're going to make a mapped page writable for.

Some of these aren't strictly necessary as we're going to perform a server
operation that might get the attributes anyway from which we can determine
if something changed - though it might not get us a callback promise.

Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Markus Suvanto <markus.suvanto@gmail.com>
cc: linux-afs@lists.infradead.org
Link: https://lore.kernel.org/r/163111667354.283156.12720698333342917516.stgit@warthog.procyon.org.uk/
2021-09-13 09:10:39 +01:00
..
2021-03-30 16:54:49 -07:00
2021-08-26 11:05:11 -07:00
2021-08-30 12:38:13 -07:00
\n
2021-08-30 10:24:50 -07:00
2021-06-14 09:07:45 +02:00
2021-04-12 15:04:29 +02:00
2021-07-06 11:06:04 -07:00
\n
2021-08-30 10:24:50 -07:00
\n
2021-08-30 10:24:50 -07:00
2021-08-30 18:52:11 -07:00
\n
2021-08-30 10:24:50 -07:00
2021-07-02 14:25:17 -07:00
2021-07-05 13:51:41 -07:00
2021-07-06 20:14:41 -04:00
\n
2021-08-30 10:04:31 -07:00
2021-06-30 12:21:16 -07:00
2021-06-29 10:53:48 -07:00
2021-08-16 10:50:32 -06:00
2021-08-30 18:52:11 -07:00
\n
2021-08-30 10:24:50 -07:00
2021-08-30 19:30:30 -07:00
2021-05-18 20:15:58 -04:00
2021-08-23 13:41:26 -06:00
2021-08-30 19:39:59 -07:00
2021-07-27 11:00:36 +02:00
2021-06-29 10:53:48 -07:00
2021-08-30 19:39:59 -07:00
2021-08-10 17:57:22 +02:00