]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
futex: Fix inode life-time issue
authorPeter Zijlstra <peterz@infradead.org>
Wed, 4 Mar 2020 10:28:31 +0000 (11:28 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 28 Apr 2020 18:03:51 +0000 (19:03 +0100)
commit87903c4d3a9b422cd1d254b693e84b95f9df0706
tree192b70c72933bea7aeb599fdfd82093947f4660f
parent08fadc32ce6239dc75fd5e869590e29bc62bbc28
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>
[bwh: Backported to 3.16: Use atomic64_cmpxchg() instead of the
 _relaxed() variant which we don't have]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/inode.c
include/linux/fs.h
include/linux/futex.h
kernel/futex.c