Files
linux/fs
J. Bruce Fields 52c571676d nfsd: allow fh_want_write to be called twice
[ Upstream commit 0b8f62625d ]

A fuzzer recently triggered lockdep warnings about potential sb_writers
deadlocks caused by fh_want_write().

Looks like we aren't careful to pair each fh_want_write() with an
fh_drop_write().

It's not normally a problem since fh_put() will call fh_drop_write() for
us.  And was OK for NFSv3 where we'd do one operation that might call
fh_want_write(), and then put the filehandle.

But an NFSv4 protocol fuzzer can do weird things like call unlink twice
in a compound, and then we get into trouble.

I'm a little worried about this approach of just leaving everything to
fh_put().  But I think there are probably a lot of
fh_want_write()/fh_drop_write() imbalances so for now I think we need it
to be more forgiving.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-15 13:47:55 +09:00
..
2018-05-30 13:19:56 +02:00
2016-05-20 17:58:30 -07:00
2023-05-15 08:58:11 +09:00
2023-05-15 12:59:41 +09:00
2023-05-15 10:31:48 +09:00
2017-11-30 08:39:04 +00:00
2023-05-15 11:49:44 +09:00
2023-05-15 10:36:26 +09:00
2016-09-27 21:20:53 -04:00
2017-07-05 16:18:14 +02:00
2023-05-15 11:50:09 +09:00
2017-09-20 09:59:51 +02:00
2017-09-26 00:32:37 -07:00
2017-09-26 00:32:37 -07:00
2018-02-17 13:21:15 +01:00
2017-07-21 08:55:50 +02:00
2017-06-14 15:06:01 +02:00
2017-12-20 10:51:15 +01:00