Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Aug 2020 15:57:43 +0400
From:      Roman Bogorodskiy <novel@freebsd.org>
To:        Jamie Gritton <jamie@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r364791 - head/usr.sbin/jail
Message-ID:  <20200826115743.GA1791@kloomba>
In-Reply-To: <202008260043.07Q0h0kH077834@repo.freebsd.org>
References:  <202008260043.07Q0h0kH077834@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--GvXjxJ+pjyke8COw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

  Jamie Gritton wrote:

> Author: jamie
> Date: Wed Aug 26 00:42:59 2020
> New Revision: 364791
> URL: https://svnweb.freebsd.org/changeset/base/364791
>=20
> Log:
>   Handle jail.conf variables that have the same names as parameters.
>  =20
>   PR:		248444
>   Submitted by:	Akos Somfai
>   Reported by:	Markus Stoff
>=20
> Modified:
>   head/usr.sbin/jail/config.c
>=20
> Modified: head/usr.sbin/jail/config.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/usr.sbin/jail/config.c	Wed Aug 26 00:31:59 2020	(r364790)
> +++ head/usr.sbin/jail/config.c	Wed Aug 26 00:42:59 2020	(r364791)
> @@ -393,7 +393,8 @@ add_param(struct cfjail *j, const struct cfparam *p, e
>  		else
>  			for (ipnum =3D IP__NULL + 1; ipnum < IP_NPARAM; ipnum++)
>  				if (!(intparams[ipnum].flags & PF_CONV) &&
> -				    equalopts(name, intparams[ipnum].name)) {
> +				    equalopts(name, intparams[ipnum].name) &&
> +				    !(p->flags & PF_VAR)) {
>  					j->intparams[ipnum] =3D np;
>  					np->flags |=3D intparams[ipnum].flags;
>  					break;

Looks like it's causing jail(8) to segfault, at least when using with
poudriere:

$
[00:00:00] Creating the reference jail... done
[00:00:07] Mounting system devices for current-local
[00:00:07] Mounting ports/packages/distfiles
[00:00:07] Using packages from previously failed build: /usr/local/poudrier=
e/data/packages/current-local/.building
[00:00:07] Mounting ccache from: /var/cache/ccache
[00:00:07] Mounting packages from: /usr/local/poudriere/data/packages/curre=
nt-local
[00:00:07] Copying /var/db/ports from: /usr/local/etc/poudriere.d/current-l=
ocal-options
[00:00:07] Appending to make.conf: /usr/local/etc/poudriere.d/current-make.=
conf
/etc/resolv.conf -> /usr/local/poudriere/data/.m/current-local/ref/etc/reso=
lv.conf
[00:00:07] Starting jail current-local
Segmentation fault (core dumped)
[00:00:08] Cleaning up
[00:00:08] Unmounting file systems
$

$ lldb /usr/sbin/jail --core /tmp/jail.core
(lldb) target create "/usr/sbin/jail" --core "/tmp/jail.core"
Core file '/tmp/jail.core' (x86_64) was loaded.

(lldb) bt all
* thread #1, name =3D 'jail', stop reason =3D signal SIGSEGV
  * frame #0: 0x000000000020c3fb jail`add_param(j=3D0x0000000800a09000, p=
=3D<unavailable>, ipnum=3D<unavailable>, value=3D<unavailable>) at config.c=
:399:16
    frame #1: 0x0000000000207e08 jail`main(argc=3D8, argv=3D0x00007fffffffe=
8f0) at jail.c:0
    frame #2: 0x0000000000206e10 jail`_start(ap=3D<unavailable>, cleanup=3D=
<unavailable>) at crt1_c.c:75:7
(lldb)=20

This works fine when I back out this change.

Roman Bogorodskiy

--GvXjxJ+pjyke8COw
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAABCAAdFiEEi6TfKtFPmbY34ABwyW1f/gjCImoFAl9GTjUACgkQyW1f/gjC
ImoeOgf9F6jI1XL7GLVdbu+Us3qRhVnxcIdRd/L1aL/eWMCwv3TfFOuf9HnOkqiv
64kjuuAFu4VCL5afNYFYjuk7vaFTrC5/W1Kq8TS6bKyuEbck3e95V4HfKCjcahVS
WZQJp4AIJqz2N1Bmv7jfk7f3zXj+K6hRwTI3AawxCyxFGEmr21+5KLwFRqi+htRl
rYxk94vy43zAwU56pP3Jpl+Jxgu324r5cFIOJz6wCK/UN79kcCzq7NgiWiYTTrIv
+BqdqhYmDgDdr4X14Fmq951RrpJgGTHiMCjilto5u5wDUMR7q/Z/ltxG8lzFmFOA
dG7aMPbZebUO7wb+s0Jq9Uco/AONGg==
=JUYG
-----END PGP SIGNATURE-----

--GvXjxJ+pjyke8COw--



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