diff options
author | David Howells <dhowells@redhat.com> | 2021-09-01 20:22:50 +0200 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2021-09-13 10:10:39 +0200 |
commit | 3978d816523991dd86cf9aae88c295230a5ea3b2 (patch) | |
tree | b7f9045e2544d879129f26dee2b40e0e2cc517c7 /arch/x86/kernel/fpu | |
parent | afs: Fix page leak (diff) | |
download | linux-3978d816523991dd86cf9aae88c295230a5ea3b2.tar.xz linux-3978d816523991dd86cf9aae88c295230a5ea3b2.zip |
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/
Diffstat (limited to 'arch/x86/kernel/fpu')
0 files changed, 0 insertions, 0 deletions