From owner-freebsd-hackers@freebsd.org Thu May 17 17:52:38 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36913EDB5D4; Thu, 17 May 2018 17:52:38 +0000 (UTC) (envelope-from fabian.freyer@physik.tu-berlin.de) Received: from mail.physik.tu-berlin.de (mail.physik-pool.tu-berlin.de [130.149.50.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8EA46CE0D; Thu, 17 May 2018 17:52:36 +0000 (UTC) (envelope-from fabian.freyer@physik.tu-berlin.de) Received: from [192.168.119.1] (wlan-141-23-160-161.tubit.tu-berlin.de [141.23.160.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.physik.tu-berlin.de (Postfix) with ESMTPSA id 51E5561FD0; Thu, 17 May 2018 17:43:59 +0000 (UTC) From: "Fabian Freyer" To: freebsd-jail@freebsd.org, freebsd-hackers@freebsd.org Subject: sizeof jail parameter value strings Date: Thu, 17 May 2018 19:43:57 +0200 X-Mailer: MailMate (1.11.2r5479) Message-ID: <6BDE831C-48AC-4FA3-B0EC-C4B7D275AFFE@physik.tu-berlin.de> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=_MailMate_A00A7A58-F35D-4F7C-AEB5-82B656D8CD52_="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 May 2018 17:52:38 -0000 This is an OpenPGP/MIME signed message (RFC 3156 and 4880). --=_MailMate_A00A7A58-F35D-4F7C-AEB5-82B656D8CD52_= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello lists, =46rom jail(3): > The jail_getv() function takes a null-terminated list of name and v= alue > strings, and passes it to jail_get(2). It is the caller's responsi= bility > to ensure that the value strings point to buffers large enough to h= old > the string representation of the returned parameters. What exactly does =E2=80=9Clarge enough=E2=80=9D mean here? Is there a wa= y to query the size of the corresponding kernel buffers at runtime? Is there a maximum length =C3= =A0 la MAX_JAIL_PARAM_LEN that the string representations of the returned parame= ters are guaranteed to be shorter than? I=E2=80=99m currently implementing a rust wrapper[1] around the jail(2) i= nterface, and am not sure how large buffers for the string parameters I=E2=80=99m querying= with jail_get jail_set have to be. Fabian (I=E2=80=99m not on the freebsd-jail mailing list, so I=E2=80=99d appreci= ate being kept in the CC) [1] https://github.com/fubarnetes/libjail-rs --=_MailMate_A00A7A58-F35D-4F7C-AEB5-82B656D8CD52_= Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQJWBAEBCgBAFiEEX6JoxdmEemcFacQZmealkcs85+YFAlr9v10iHGZhYmlhbi5m cmV5ZXJAcGh5c2lrLnR1LWJlcmxpbi5kZQAKCRCZ5qWRyzzn5vs9D/40QAEzqkm2 BCyUzh4lJ1uihMPU8x1u1L+pef7ocBJ8zVX/atLAroX5+08zlT8crZqMmz7fvzaa Ba4M3xwIrg0n5OHVWoskPlLs7T0N1WazfIzd733/S5FKfAp8c6GMn1QnMEmTHzzw 45vA0XlIb+0AeiDn+ydcb2AMrpFE6KMq33MmI5qBWzrzsfbRl3rj9jjATcnCZbGq IR11+LAk/jbJgOHEiWWuM2ErFrzsZ1Gv/OI+hiNYiqb7hRM9waTRzLBoQmOdMbUq CgfCuF780mFJxUfLSRv466ISssmmyyA4npv4QKBzVB19raltoJeP0hTn/vIUYcKn bVte/QouOlVJgGFI63zOFBLYY+W6P/7Cq+MlYQADRg3VSWZwekUgr/Ptjc7UpJiV k1PZGSXmh1Vv+soK0b2CbXj/WxuA3hOaFt4cT60R7QmNlVoYDrRNOQ60OEOB/nO8 pm/grbM2ECFn1CpaRWJfp3BDJ9/3tfbvDh/hFa1IDMaWhf6QkJlEpYpzYVDVxrL6 m9SGtPA4RQ1d/FYUJWU3xMf0k6gSe9tLSBz/D2SQ38THDO9+035I85To7aChtav5 AVdWob4OCBLwOKsp594uQkyVHuHKS3d3rf2Piu+hOtioBRcPfJJlUvCgERx6dRoY VOtU+YhlDyso81qzvq4s+oLptmOjf1inRQ== =J/MM -----END PGP SIGNATURE----- --=_MailMate_A00A7A58-F35D-4F7C-AEB5-82B656D8CD52_=--