]> git.baikalelectronics.ru Git - kernel.git/commit
NFSD: Fix exposure in nfsd4_decode_bitmap()
authorChuck Lever <chuck.lever@oracle.com>
Sun, 14 Nov 2021 20:16:04 +0000 (15:16 -0500)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 15 Nov 2021 20:33:10 +0000 (15:33 -0500)
commit21daaff3e41180b6fbc0aaf31dd41a25a177d68c
tree89686f8c5bb9f59109ca919a3539c89c31d06b22
parentc7145262179b94bb5bb796d64e493c7b977a2623
NFSD: Fix exposure in nfsd4_decode_bitmap()

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: 71bd68cc86bf ("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>
fs/nfsd/nfs4xdr.c