Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 May 2018 19:43:57 +0200
From:      "Fabian Freyer" <fabian.freyer@physik.tu-berlin.de>
To:        freebsd-jail@freebsd.org, freebsd-hackers@freebsd.org
Subject:   sizeof jail parameter value strings
Message-ID:  <6BDE831C-48AC-4FA3-B0EC-C4B7D275AFFE@physik.tu-berlin.de>

index | next in thread | raw e-mail

[-- Attachment #1 --]
Hello lists,

From jail(3):

>     The jail_getv() function takes a null-terminated list of name and value
>     strings, and passes it to jail_get(2).  It is the caller's responsibility
>     to ensure that the value strings point to buffers large enough to hold
>     the string representation of the returned parameters.

What exactly does “large enough” mean here? Is there a way to query the size of
the corresponding kernel buffers at runtime? Is there a maximum length à la
MAX_JAIL_PARAM_LEN that the string representations of the returned parameters
are guaranteed to be shorter than?

I’m currently implementing a rust wrapper[1] around the jail(2) interface, and am
not sure how large buffers for the string parameters I’m querying with jail_get
jail_set have to be.

Fabian

(I’m not on the freebsd-jail mailing list, so I’d appreciate being kept in the CC)

[1] https://github.com/fubarnetes/libjail-rs
[-- Attachment #2 --]
-----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-----
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6BDE831C-48AC-4FA3-B0EC-C4B7D275AFFE>