]> git.dujemihanovic.xyz Git - linux.git/commit
debugfs: initialize cancellations earlier
authorJohannes Berg <johannes.berg@intel.com>
Thu, 21 Dec 2023 14:04:45 +0000 (15:04 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 22 Dec 2023 06:33:02 +0000 (07:33 +0100)
commit159f5bdadcdda638aad5a234b58d6031aa4ef8aa
tree3e70d371abd1f854a990c0d1e5940a487157efd4
parentd4005431673929a1259ad791db87408fcf85d2cc
debugfs: initialize cancellations earlier

Tetsuo Handa pointed out that in the (now reverted)
lockdep commit I initialized the data too late. The
same is true for the cancellation data, it must be
initialized before the cmpxchg(), otherwise it may
be done twice and possibly even overwriting data in
there already when there's a race. Fix that, which
also requires destroying the mutex in case we lost
the race.

Fixes: 8c88a474357e ("debugfs: add API to allow debugfs operations cancellation")
Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://lore.kernel.org/r/20231221150444.1e47a0377f80.If7e8ba721ba2956f12c6e8405e7d61e154aa7ae7@changeid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/debugfs/file.c