nfs: Avoid integer overflow in nfs_namei bounds check.
XXX pullup-8 XXX pullup-9 XXX pullup-10
This commit is contained in:
parent
bb406b518d
commit
9b69ffe4d3
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: nfs_srvsubs.c,v 1.16 2022/04/27 17:38:52 hannken Exp $ */
|
/* $NetBSD: nfs_srvsubs.c,v 1.17 2023/03/23 19:52:42 riastradh Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1989, 1993
|
* Copyright (c) 1989, 1993
|
||||||
|
@ -70,7 +70,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: nfs_srvsubs.c,v 1.16 2022/04/27 17:38:52 hannken Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: nfs_srvsubs.c,v 1.17 2023/03/23 19:52:42 riastradh Exp $");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/proc.h>
|
#include <sys/proc.h>
|
||||||
|
@ -129,7 +129,7 @@ nfs_namei(struct nameidata *ndp, nfsrvfh_t *nsfh, uint32_t len, struct nfssvc_so
|
||||||
*retdirp = NULL;
|
*retdirp = NULL;
|
||||||
ndp->ni_pathbuf = NULL;
|
ndp->ni_pathbuf = NULL;
|
||||||
|
|
||||||
if ((len + 1) > NFS_MAXPATHLEN)
|
if (len > NFS_MAXPATHLEN - 1)
|
||||||
return (ENAMETOOLONG);
|
return (ENAMETOOLONG);
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
return (EACCES);
|
return (EACCES);
|
||||||
|
|
Loading…
Reference in New Issue