NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/59563: Use of FS_UFS2_MAGIC is problematic
The following reply was made to PR kern/59563; it has been noted by GNATS.
From: Christos Zoulas <christos%zoulas.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: kern-bug-people%netbsd.org@localhost,
gnats-admin%netbsd.org@localhost,
netbsd-bugs%netbsd.org@localhost
Subject: Re: kern/59563: Use of FS_UFS2_MAGIC is problematic
Date: Tue, 29 Jul 2025 15:09:41 -0400
--Apple-Mail=_4BE8684E-8946-46D1-BA6E-65ADD54AC000
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=us-ascii
Does not matter, because:
/* Allow converting from UFS2 to UFS2EA but not vice versa. */
if (newfs->fs_magic =3D=3D FS_UFS2EA_MAGIC) {
ump->um_flags |=3D UFS_EA;
newfs->fs_magic =3D FS_UFS2_MAGIC;
} else {
if ((ump->um_flags & UFS_EA) !=3D 0)
return EINVAL;
}
If that was not the case we would get corruption and crashes. But I =
agree with you, it is better to do the test one way and perhaps put it =
in a macro.
christos=
--Apple-Mail=_4BE8684E-8946-46D1-BA6E-65ADD54AC000
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename=signature.asc
Content-Type: application/pgp-signature;
name=signature.asc
Content-Description: Message signed with OpenPGP
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
iF0EARECAB0WIQS+BJlbqPkO0MDBdsRxESqxbLM7OgUCaIkcdQAKCRBxESqxbLM7
Oo5uAKDKaG+aPrLtgl2pZ0FoT0kW6AV0twCdFZaMCq9aSSG1YFWheMme+fuTOzA=
=OI9O
-----END PGP SIGNATURE-----
--Apple-Mail=_4BE8684E-8946-46D1-BA6E-65ADD54AC000--
Home |
Main Index |
Thread Index |
Old Index