diff options
author | jamie <jamie@FreeBSD.org> | 2010-09-10 21:45:42 +0000 |
---|---|---|
committer | jamie <jamie@FreeBSD.org> | 2010-09-10 21:45:42 +0000 |
commit | 5a233127aa8c78e47c4fa646fa26213dadb55ba9 (patch) | |
tree | 4db0760712010aa135da435a23c05a6e6c3c231c | |
parent | b25dd573cd642a9d6763b077a57a6c2331e9a3cf (diff) | |
download | FreeBSD-src-5a233127aa8c78e47c4fa646fa26213dadb55ba9.zip FreeBSD-src-5a233127aa8c78e47c4fa646fa26213dadb55ba9.tar.gz |
Don't exit kern_jail_set without freeing options when enforce_statfs
has an illegal value.
MFC after: 3 days
-rw-r--r-- | sys/kern/kern_jail.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index ded2379..4882e8e 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -584,12 +584,15 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) gotchildmax = 1; error = vfs_copyopt(opts, "enforce_statfs", &enforce, sizeof(enforce)); - gotenforce = (error == 0); - if (gotenforce) { - if (enforce < 0 || enforce > 2) - return (EINVAL); - } else if (error != ENOENT) + if (error == ENOENT) + gotenforce = 0; + else if (error != 0) goto done_free; + else if (enforce < 0 || enforce > 2) { + error = EINVAL; + goto done_free; + } else + gotenforce = 1; pr_flags = ch_flags = 0; for (fi = 0; fi < sizeof(pr_flag_names) / sizeof(pr_flag_names[0]); |