Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Sep 2010 00:42:07 +0000 (UTC)
From:      Jamie Gritton <jamie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r212510 - stable/8/sys/kern
Message-ID:  <201009130042.o8D0g7hi040407@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jamie
Date: Mon Sep 13 00:42:07 2010
New Revision: 212510
URL: http://svn.freebsd.org/changeset/base/212510

Log:
  MFC r212436:
  
    Don't exit kern_jail_set without freeing options when enforce_statfs
    has an illegal value.

Modified:
  stable/8/sys/kern/kern_jail.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/kern/kern_jail.c
==============================================================================
--- stable/8/sys/kern/kern_jail.c	Mon Sep 13 00:38:46 2010	(r212509)
+++ stable/8/sys/kern/kern_jail.c	Mon Sep 13 00:42:07 2010	(r212510)
@@ -584,12 +584,15 @@ kern_jail_set(struct thread *td, struct 
 		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]);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009130042.o8D0g7hi040407>