futex: Fix inode life-time issue
authorPeter Zijlstra <peterz@infradead.org>
Wed, 4 Mar 2020 10:28:31 +0000 (11:28 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Apr 2020 14:34:21 +0000 (16:34 +0200)
commite52694b56eb6d4b1fe424bda6126b8ce13c246a8
treeb35d00605eeeac7fa378fdc200dd7fedbf40805c
parentdafda49dfbf600de7d8d68d79b7b36df59c84584
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>
fs/inode.c
include/linux/fs.h
include/linux/futex.h
kernel/futex.c