Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Nov 2013 19:40:34 +0000 (UTC)
From:      Peter Wemm <peter@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r258718 - in head/sys: compat/freebsd32 kern
Message-ID:  <201311281940.rASJeYvS075788@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: peter
Date: Thu Nov 28 19:40:33 2013
New Revision: 258718
URL: http://svnweb.freebsd.org/changeset/base/258718

Log:
  jail_v0.ip_number was always in host byte order.  This was handled
  in one of the many layers of indirection and shims through stable/7
  in jail_handle_ips().  When it was cleaned up and unified through
  kern_jail() for 8.x, the byte order swap was lost.
  
  This only matters for ancient binaries that call jail(2) themselves
  internally.

Modified:
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/kern/kern_jail.c

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_misc.c	Thu Nov 28 19:37:22 2013	(r258717)
+++ head/sys/compat/freebsd32/freebsd32_misc.c	Thu Nov 28 19:40:33 2013	(r258718)
@@ -1928,7 +1928,7 @@ freebsd32_jail(struct thread *td, struct
 		CP(j32_v0, j, version);
 		PTRIN_CP(j32_v0, j, path);
 		PTRIN_CP(j32_v0, j, hostname);
-		j.ip4s = j32_v0.ip_number;
+		j.ip4s = htonl(j32_v0.ip_number);	/* jail_v0 is host order */
 		break;
 	}
 

Modified: head/sys/kern/kern_jail.c
==============================================================================
--- head/sys/kern/kern_jail.c	Thu Nov 28 19:37:22 2013	(r258717)
+++ head/sys/kern/kern_jail.c	Thu Nov 28 19:40:33 2013	(r258718)
@@ -314,7 +314,7 @@ sys_jail(struct thread *td, struct jail_
 		j.version = j0.version;
 		j.path = j0.path;
 		j.hostname = j0.hostname;
-		j.ip4s = j0.ip_number;
+		j.ip4s = htonl(j0.ip_number);	/* jail_v0 is host order */
 		break;
 	}
 



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