Chuck Lever 10c22d9519 NFSD: Fix exposure in nfsd4_decode_bitmap()
[ Upstream commit c0019b7db1d7ac62c711cda6b357a659d46428fe ]

rtm@csail.mit.edu reports:
> nfsd4_decode_bitmap4() will write beyond bmval[bmlen-1] if the RPC
> directs it to do so. This can cause nfsd4_decode_state_protect4_a()
> to write client-supplied data beyond the end of
> nfsd4_exchange_id.spo_must_allow[] when called by
> nfsd4_decode_exchange_id().

Rewrite the loops so nfsd4_decode_bitmap() cannot iterate beyond
@bmlen.

Reported by: rtm@csail.mit.edu
Fixes: d1c263a031e8 ("NFSD: Replace READ* macros in nfsd4_decode_fattr()")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-11-25 09:48:35 +01:00
..
2021-02-23 13:39:45 -08:00
2021-01-25 09:36:28 -05:00
2020-09-25 18:01:26 -04:00
2021-01-24 14:27:17 +01:00
2021-09-22 09:21:02 -07:00
2021-08-26 15:32:28 -04:00
2021-03-22 10:19:02 -04:00
2021-01-25 09:36:28 -05:00
2021-08-31 10:57:06 -07:00
2018-09-25 20:34:54 -04:00