The last entry in the ext2_opts array must be NULL,

otherwise the kernel with crash in vfs_filteropt() if an invalid
mount option is passed to ext2fs.

Approved by:	re (kensmith)
This commit is contained in:
rodrigc 2007-07-14 21:18:19 +00:00
parent 5cecbb94f3
commit def1240ba2
3 changed files with 14 additions and 1 deletions

View File

@ -119,7 +119,7 @@ static int compute_sb_data(struct vnode * devvp,
static const char *ext2_opts[] = { "from", "export", "union", "acls", "exec",
"atime", "union", "suiddir", "multilabel", "symfollow", "clusterr",
"clusterw", "force" };
"clusterw", "force", NULL };
/*
* VFS Operations.

View File

@ -1059,6 +1059,15 @@ kqueue_expand(struct kqueue *kq, struct filterops *fops, uintptr_t ident,
int fd;
int mflag = waitok ? M_WAITOK : M_NOWAIT;
/*
* knote locks the KQ and filt_proc calls kqueue_register if _TRACK
* is set. Return early so we don't assert KQ_NOTOWNED in this
* case. We have a knote in the hash, so we have the table.
*/
if ((fops->f_isfd && kq->kq_knlistsize > ident) ||
(!fops->f_isfd && kq->kq_knhashmask != 0))
return 0;
KQ_NOTOWNED(kq);
if (fops->f_isfd) {

View File

@ -638,6 +638,10 @@ vfs_donmount(struct thread *td, int fsflags, struct uio *fsoptions)
fsflags &= ~MNT_ASYNC;
else if (strcmp(opt->name, "noatime") == 0)
fsflags |= MNT_NOATIME;
else if (strcmp(opt->name, "atime") == 0) {
free(opt->name, M_MOUNT);
opt->name = strdup("nonoatime", M_MOUNT);
}
else if (strcmp(opt->name, "noclusterr") == 0)
fsflags |= MNT_NOCLUSTERR;
else if (strcmp(opt->name, "noclusterw") == 0)