Skip site navigation (1)Skip section navigation (2)
Date:      2024-06-04 06:26:09 +0000

| raw e-mail | index | archive | help
So this is due to makefs pulling this code in. That's built both as a host
tool and as a normal target tool. The former is only used to make make
release work, iirc and will create small MSDOS images for EFI, where the
code in question likely doesn't matter. The latter is also used for the
target program newfs_msdos, which is used generically on a FreeBSD system
to make a filesystem. That program will have been built with the target's
PAGE_SIZE, so is fine.

There might be slight differences in images generated without the -a flag,
but even then the release images are just used for the installer where
minor differences like this won't matter.

So newfs_msdos: Same no matter how built.
FreeBSD release image: Minor, trivial variation, maybe, in the created
image. We don't guarantee 100% reproducible images in general just yet.

Warner

Could the value of alignto be different on step 1 versus step 3?
>
> Thanks,
>
> --
> Shawn Webb
> Cofounder / Security Engineer
> HardenedBSD
>
> Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50
>
> https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/0=
3A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc
>

--000000000000b0449b061a125c4d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Tue, Jun 4, 2024 at 9:22=E2=80=AFA=
M Shawn Webb &lt;<a href=3D"mailto:shawn.webb@hardenedbsd.org">shawn.webb@h=
ardenedbsd.org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padd=
ing-left:1ex">On Tue, Jun 04, 2024 at 06:28:19AM +0000, Stefan E=C3=9Fer wr=
ote:<br>
&gt; The branch main has been updated by se:<br>
&gt; <br>
&gt; URL: <a href=3D"https://cgit.FreeBSD.org/src/commit/?id=3D41ee91c64f47=
faaa8131df3cd8a63bdb60fa486a" rel=3D"noreferrer" target=3D"_blank">https://=
cgit.FreeBSD.org/src/commit/?id=3D41ee91c64f47faaa8131df3cd8a63bdb60fa486a<=
/a><br>
&gt; <br>
&gt; commit 41ee91c64f47faaa8131df3cd8a63bdb60fa486a<br>
&gt; Author:=C2=A0 =C2=A0 =C2=A0Stefan E=C3=9Fer &lt;se@FreeBSD.org&gt;<br>
&gt; AuthorDate: 2024-06-04 06:26:09 +0000<br>
&gt; Commit:=C2=A0 =C2=A0 =C2=A0Stefan E=C3=9Fer &lt;se@FreeBSD.org&gt;<br>
&gt; CommitDate: 2024-06-04 06:26:09 +0000<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0newfs_msdos: fix build on non-FreeBSD systems<br>
&gt;=C2=A0 =C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0Disable data area alignment if the build environmen=
t does not define<br>
&gt;=C2=A0 =C2=A0 =C2=A0PAGE_SIZE (e.g., when building on Linux or macOS).<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0Reported by:=C2=A0 =C2=A0 jrtc27<br>
&gt;=C2=A0 =C2=A0 =C2=A0MFC after:=C2=A0 =C2=A0 =C2=A0 1 week<br>
&gt; ---<br>
&gt;=C2=A0 sbin/newfs_msdos/mkfs_msdos.c | 4 ++++<br>
&gt;=C2=A0 1 file changed, 4 insertions(+)<br>
&gt; <br>
&gt; diff --git a/sbin/newfs_msdos/mkfs_msdos.c b/sbin/newfs_msdos/mkfs_msd=
os.c<br>
&gt; index 423fbbcadcc5..1bca560a59e1 100644<br>
&gt; --- a/sbin/newfs_msdos/mkfs_msdos.c<br>
&gt; +++ b/sbin/newfs_msdos/mkfs_msdos.c<br>
&gt; @@ -571,7 +571,11 @@ mkfs_msdos(const char *fname, const char *dtype, =
const struct msdos_options *op)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (o.align)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0alignto =3D bpb.=
bpbSecPerClust;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0else<br>
&gt; +#ifdef=C2=A0 =C2=A0 =C2=A0 =C2=A0PAGE_SIZE<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0alignto =3D PAGE=
_SIZE / bpb.bpbBytesPerSec;<br>
&gt; +#else<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0alignto =3D 1;<br>
&gt; +#endif<br>
<br>
Imagine the following:<br>
<br>
1. someone builds FreeBSD on Linux or macOS<br>
2. that build is deployed<br>
3. FreeBSD is rebuilt on that deployment<br></blockquote><div><br></div><di=
v>So this is due to makefs pulling this code in. That&#39;s built both as a=
 host tool and as a normal target tool. The former is only used to make mak=
e release work, iirc and will create small MSDOS images for EFI, where the =
code in question likely doesn&#39;t matter. The latter is also used for the=
 target program newfs_msdos, which is used generically on a FreeBSD system =
to make a filesystem. That program will have been built with the target&#39=
;s PAGE_SIZE, so is fine.</div><div><br></div><div>There might be slight di=
fferences in images generated without the -a flag, but even then the releas=
e images are just used for the installer where minor differences like this =
won&#39;t matter.</div><div><br></div><div>So newfs_msdos: Same no matter h=
ow built.</div><div>FreeBSD release image: Minor, trivial variation, maybe,=
 in the created image. We don&#39;t guarantee 100% reproducible images in g=
eneral just yet.</div><div><br></div><div>Warner</div><div><br></div><block=
quote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1=
px solid rgb(204,204,204);padding-left:1ex">
Could the value of alignto be different on step 1 versus step 3?<br><br>
Thanks,<br>
<br>
-- <br>
Shawn Webb<br>
Cofounder / Security Engineer<br>
HardenedBSD<br>
<br>
Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50<br>
<a href=3D"https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Sha=
wn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc" rel=3D"noreferrer=
" target=3D"_blank">https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/m=
aster/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc</a><br>
</blockquote></div></div>

--000000000000b0449b061a125c4d--



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