diff options
author | Linus Torvalds | 2020-08-03 10:19:35 -0700 |
---|---|---|
committer | Linus Torvalds | 2020-08-03 10:19:35 -0700 |
commit | 5577416c39652d395a6045677f4f598564aba1cf (patch) | |
tree | 349c0ac19ffc23fcd759beb4d8a929b633d61b4f /include | |
parent | 690b25675f5c9c082cb1b902e6d21dd956754e7e (diff) | |
parent | f3db0bed458314a835ccef5ccb130270c5b2cf04 (diff) |
Merge tag 'fsverity-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt
Pull fsverity update from Eric Biggers:
"One fix for fs/verity/ to strengthen a memory barrier which might be
too weak. This mirrors a similar fix in fs/crypto/"
* tag 'fsverity-for-linus' of git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt:
fs-verity: use smp_load_acquire() for ->i_verity_info
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/fsverity.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/fsverity.h b/include/linux/fsverity.h index 78201a6d35f6..c1144a450392 100644 --- a/include/linux/fsverity.h +++ b/include/linux/fsverity.h @@ -115,8 +115,13 @@ struct fsverity_operations { static inline struct fsverity_info *fsverity_get_info(const struct inode *inode) { - /* pairs with the cmpxchg() in fsverity_set_info() */ - return READ_ONCE(inode->i_verity_info); + /* + * Pairs with the cmpxchg_release() in fsverity_set_info(). + * I.e., another task may publish ->i_verity_info concurrently, + * executing a RELEASE barrier. We need to use smp_load_acquire() here + * to safely ACQUIRE the memory the other task published. + */ + return smp_load_acquire(&inode->i_verity_info); } /* enable.c */ |