diff options
| author | Peter Zijlstra <peterz@infradead.org> | 2020-03-04 11:28:31 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-03-25 08:25:58 +0100 |
| commit | 553d46b07dc4813e1d8e6a3b3d6eb8603b4dda74 (patch) | |
| tree | 82b6e984ea9e03f5c5504c668022022f68e50061 /fs/inode.c | |
| parent | 66f28e110565595800d6253938befef3fa88625b (diff) | |
| download | linux-553d46b07dc4813e1d8e6a3b3d6eb8603b4dda74.tar.gz linux-553d46b07dc4813e1d8e6a3b3d6eb8603b4dda74.tar.bz2 linux-553d46b07dc4813e1d8e6a3b3d6eb8603b4dda74.zip | |
futex: Fix inode life-time issue
commit 8019ad13ef7f64be44d4f892af9c840179009254 upstream.
As reported by Jann, ihold() does not in fact guarantee inode
persistence. And instead of making it so, replace the usage of inode
pointers with a per boot, machine wide, unique inode identifier.
This sequence number is global, but shared (file backed) futexes are
rare enough that this should not become a performance issue.
Reported-by: Jann Horn <jannh@google.com>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/inode.c')
| -rw-r--r-- | fs/inode.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/inode.c b/fs/inode.c index 96d62d97694e..c5267a4db0f5 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -137,6 +137,7 @@ int inode_init_always(struct super_block *sb, struct inode *inode) inode->i_sb = sb; inode->i_blkbits = sb->s_blocksize_bits; inode->i_flags = 0; + atomic64_set(&inode->i_sequence, 0); atomic_set(&inode->i_count, 1); inode->i_op = &empty_iops; inode->i_fop = &no_open_fops; |
