Page MenuHomeFreeBSD

D24753.id71526.diff
No OneTemporary

D24753.id71526.diff

Index: sys/kern/vfs_export.c
===================================================================
--- sys/kern/vfs_export.c
+++ sys/kern/vfs_export.c
@@ -112,6 +112,11 @@
#endif
int error;
+ KASSERT(argp->ex_numsecflavors > 0,
+ ("%s: numsecflavors <= 0", __func__));
+ KASSERT(argp->ex_numsecflavors < MAXSECFLAVORS,
+ ("%s: numsecflavors >= MAXSECFLAVORS", __func__));
+
/*
* XXX: This routine converts from a `struct xucred'
* (argp->ex_anon) to a `struct ucred' (np->netc_anon). This
@@ -300,7 +305,7 @@
struct netexport *nep;
int error;
- if (argp->ex_numsecflavors < 0
+ if (argp->ex_numsecflavors <= 0
|| argp->ex_numsecflavors >= MAXSECFLAVORS)
return (EINVAL);
@@ -518,8 +523,13 @@
*extflagsp = np->netc_exflags;
if ((*credanonp = np->netc_anon) != NULL)
crhold(*credanonp);
- if (numsecflavors)
+ if (numsecflavors) {
*numsecflavors = np->netc_numsecflavors;
+ KASSERT(*numsecflavors > 0,
+ ("%s: numsecflavors <= 0", __func__));
+ KASSERT(*numsecflavors < MAXSECFLAVORS,
+ ("%s: numsecflavors >= MAXSECFLAVORS", __func__));
+ }
if (secflavors)
*secflavors = np->netc_secflavors;
lockmgr(&mp->mnt_explock, LK_RELEASE, NULL);

File Metadata

Mime Type
text/plain
Expires
Sun, Jan 19, 5:20 PM (5 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15951367
Default Alt Text
D24753.id71526.diff (1 KB)

Event Timeline