diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c index dd217822b2b5..082bb0aea123 100644 --- a/sys/kern/vfs_export.c +++ b/sys/kern/vfs_export.c @@ -129,6 +129,10 @@ vfs_hang_addrlist(mp, nep, argp) saddr = (struct sockaddr *) (np + 1); if ((error = copyin(argp->ex_addr, saddr, argp->ex_addrlen))) goto out; + if (saddr->sa_family > SA_MAX) { + error = EINVAL; + goto out; + } if (saddr->sa_len > argp->ex_addrlen) saddr->sa_len = argp->ex_addrlen; if (argp->ex_masklen) {