Ted Bullock <[email protected]> wrote:
> On 2021-11-15 12:28 p.m., Theo de Raadt wrote:
> > Otto Moerbeek <[email protected]> wrote:
> >> So you build code with just the struct fs_ops change, while
> >> keeping everything else the same?
> >>
> >> Very puzzling...
> > indeed, you are losing us Ted.
> > Just comment out the fchmod() call.
> > Does it work then?
>
> Yes the system boots fine with the fchmod call commented out on the
> most recent -current snapshot.
>
> Regarding my other comment, I was looking for other calls to fchmod in
> the bootblock and thought I saw it was being called elsewhere from the
> commentary on the patch notes but actually searching bootblock
> directory says otherwise.
>From a MI viewpoint, fchmod is used in two different places:
sys/stand/boot.c
/* Prevent re-upgrade: chmod a-x bsd.upgrade */
if (isupgrade) {
struct stat st;
if (fstat(fd, &st) == 0) {
st.st_mode &=
~(S_IXUSR|S_IXGRP|S_IXOTH);
if (fchmod(fd, st.st_mode) == -1)
and
if (sb.st_mode & S_ISTXT) {
printf("NOTE: random seed is being reused.\n");
error = -1;
goto done;
}
fchmod(fd, sb.st_mode | S_ISTXT);
But sparc64 doesn't use the MI boot.c, so it only contains the latter fchmod()
operation in the MD sys/arch/sparc64/stand/ofwboot/boot.c
I didn't bother adding the re-upgrade chunk to ofwboot, because one day I want
sparc64 to use MI boot.c
I do want fchmod for random reuse on most sparc64 machines. But if OFW "write"
support isn't working on some machines, we should nop it out. Luckily this is
in MD code.