aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/client.c
diff options
context:
space:
mode:
authorRandy Dunlap <rdunlap@infradead.org>2021-03-01 16:19:30 -0800
committerTrond Myklebust <trond.myklebust@hammerspace.com>2021-04-05 09:04:20 -0400
commitc09f11ef35955785f92369e25819bf0629df2e59 (patch)
treedb4dd00b82d079280c7e335d688337cdfdf3003c /fs/nfs/client.c
parentNFS: Only change the cookie verifier if the directory page cache is empty (diff)
downloadlinux-dev-c09f11ef35955785f92369e25819bf0629df2e59.tar.xz
linux-dev-c09f11ef35955785f92369e25819bf0629df2e59.zip
NFS: fs_context: validate UDP retrans to prevent shift out-of-bounds
Fix shift out-of-bounds in xprt_calc_majortimeo(). This is caused by a garbage timeout (retrans) mount option being passed to nfs mount, in this case from syzkaller. If the protocol is XPRT_TRANSPORT_UDP, then 'retrans' is a shift value for a 64-bit long integer, so 'retrans' cannot be >= 64. If it is >= 64, fail the mount and return an error. Fixes: 9954bf92c0cd ("NFS: Move mount parameterisation bits into their own file") Reported-by: syzbot+ba2e91df8f74809417fa@syzkaller.appspotmail.com Reported-by: syzbot+f3a0fa110fd630ab56c8@syzkaller.appspotmail.com Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Trond Myklebust <trond.myklebust@hammerspace.com> Cc: Anna Schumaker <anna.schumaker@netapp.com> Cc: linux-nfs@vger.kernel.org Cc: David Howells <dhowells@redhat.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: stable@vger.kernel.org Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'fs/nfs/client.c')
0 files changed, 0 insertions, 0 deletions