Date: Wed, 24 Jun 2020 00:15:37 -0400 From: "Mikhail T." <mi+m@aldan.algebra.com> To: Martin Simmons <martin@lispworks.com> Cc: "Mikhail T." <mi+t@aldan.algebra.com>, "jkim@freebsd.org" <jkim@freebsd.org>, "mmokhi@freebsd.org" <mmokhi@freebsd.org>, "vbox@freebsd.org" <vbox@freebsd.org> Subject: Re: Old bug in patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c Message-ID: <72075655-676A-461A-8E2C-87AA866D6E68@aldan.algebra.com> In-Reply-To: <202006231847.05NIl6eH007223@higson.cam.lispworks.com> References: <202006231847.05NIl6eH007223@higson.cam.lispworks.com>
next in thread | previous in thread | raw e-mail | index | archive | help
I don=E2=80=99t know - the compiler only warned about the bzero :-) But you may be right - and the module never worked for me anyway... --=20 Sent from mobile device, please, pardon shorthand. > 23 =D1=87=D0=B5=D1=80=D0=B2. 2020 =D1=80. =D0=BE 14:47 Martin Simmons <mar= tin@lispworks.com> =D0=BF=D0=B8=D1=88=D0=B5: >=20 > =EF=BB=BFIs the memcpy wrong too? It looks like fsinfo.serial is a single= uint32_t > (i.e. 32 bits), but mp->mnt_stat.f_fsid is a pair of int32_t (i.e. 64 bits= ), > so copying this pair from fsinfo.serial is wrong. >=20 > __Martin >=20 >=20 >>>>>> On Mon, 22 Jun 2020 14:22:05 -0400, Mikhail T said: >>=20 >> Gentlemen! >>=20 >> An old bug in the patch is causing compiler-warnings, and leads to=20 >> erroneous behavior where pointers are bigger than 32-bit. >>=20 >> Moreover, given the memcpy right after it, the bzero is simply not=20 >> needed at all. Instead of removing the bogus ampersand, the entire line=20= >> should be deleted. (I would've replaced the memcpy with an assignment=20 >> too, but that's not as pressing.) >>=20 >> Can I commit this? >>=20 >> Index: files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.= c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c >> (revision 539883) >> +++ files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c >> (working copy) >> @@ -11,7 +11,7 @@ >> * >> * This file is part of VirtualBox Open Source Edition (OSE), as >> * available from http://www.virtualbox.org. This file is free >> software; >> -@@ -14,245 +9,479 @@ >> +@@ -14,245 +9,478 @@ >> * VirtualBox OSE distribution. VirtualBox OSE is distributed in th= e >> * hope that it will be useful, but WITHOUT ANY WARRANTY of any kin= d. >> */ >> @@ -466,7 +466,6 @@ >> + >> + MNT_ILOCK(mp); >> + mp->mnt_data =3D vboxfsmp; >> *-+ bzero(&mp->mnt_stat.f_fsid, sizeof(&mp->mnt_stat.f_fsid));* >> + /* f_fsid is int32_t but serial is uint32_t, convert */ >> + memcpy(&mp->mnt_stat.f_fsid, &fsinfo.serial, >> sizeof(mp->mnt_stat.f_fsid)); >> + mp->mnt_flag |=3D MNT_LOCAL; >>=20 >> Thanks. Yours, >>=20 >> -mi >>=20 >> _______________________________________________ >> freebsd-emulation@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-emulation >> To unsubscribe, send any mail to "freebsd-emulation-unsubscribe@freebsd.o= rg" >>=20
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?72075655-676A-461A-8E2C-87AA866D6E68>