From owner-freebsd-emulation@freebsd.org Tue Jun 23 18:47:24 2020 Return-Path: Delivered-To: freebsd-emulation@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E5A3335BE4 for ; Tue, 23 Jun 2020 18:47:24 +0000 (UTC) (envelope-from martin@lispworks.com) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 49rwHw0P0Fz3yBc for ; Tue, 23 Jun 2020 18:47:24 +0000 (UTC) (envelope-from martin@lispworks.com) Received: by mailman.nyi.freebsd.org (Postfix) id 0D63B335A2F; Tue, 23 Jun 2020 18:47:24 +0000 (UTC) Delivered-To: emulation@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D274335651 for ; Tue, 23 Jun 2020 18:47:24 +0000 (UTC) (envelope-from martin@lispworks.com) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49rwHv5JtPz3yBy for ; Tue, 23 Jun 2020 18:47:23 +0000 (UTC) (envelope-from martin@lispworks.com) Received: by freefall.freebsd.org (Postfix) id 9D570CC50; Tue, 23 Jun 2020 18:47:23 +0000 (UTC) Delivered-To: vbox@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 8FD6CCE9D; Tue, 23 Jun 2020 18:47:23 +0000 (UTC) (envelope-from martin@lispworks.com) Received: from mail.lispworks.com (mail.lispworks.com [46.17.166.21]) by mx1.freebsd.org (Postfix) with ESMTP id 49rwHt2QkGz3yJr; Tue, 23 Jun 2020 18:47:22 +0000 (UTC) (envelope-from martin@lispworks.com) Received: from higson.cam.lispworks.com (higson.cam.lispworks.com [192.168.1.7]) by lwfs1-cam.cam.lispworks.com (8.15.2/8.15.2) with ESMTP id 05NIl6CD012137; Tue, 23 Jun 2020 19:47:06 +0100 (BST) (envelope-from martin@lispworks.com) Received: from higson.cam.lispworks.com (localhost.localdomain [127.0.0.1]) by higson.cam.lispworks.com (8.14.4) id 05NIl6pM007227; Tue, 23 Jun 2020 19:47:06 +0100 Received: (from martin@localhost) by higson.cam.lispworks.com (8.14.4/8.14.4/Submit) id 05NIl6eH007223; Tue, 23 Jun 2020 19:47:06 +0100 Date: Tue, 23 Jun 2020 19:47:06 +0100 Message-Id: <202006231847.05NIl6eH007223@higson.cam.lispworks.com> From: Martin Simmons To: "Mikhail T." CC: jkim@FreeBSD.org, mmokhi@FreeBSD.org, vbox@FreeBSD.org In-reply-to: <101fc234-e5c2-e8c3-9c07-3eb922c01736@aldan.algebra.com> (mi+t@aldan.algebra.com) Subject: Re: Old bug in patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c References: <101fc234-e5c2-e8c3-9c07-3eb922c01736@aldan.algebra.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 49rwHt2QkGz3yJr X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of martin@lispworks.com has no SPF policy when checking 46.17.166.21) smtp.mailfrom=martin@lispworks.com X-Spamd-Result: default: False [0.75 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-0.03)[-0.027]; TAGGED_RCPT(0.00)[t]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[lispworks.com]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.14)[0.138]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.36)[-0.359]; RCVD_IN_DNSWL_NONE(0.00)[46.17.166.21:from]; R_SPF_NA(0.00)[no SPF record]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:51055, ipnet:46.17.166.0/24, country:GB]; RWL_MAILSPIKE_VERYGOOD(0.00)[46.17.166.21:from] X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2020 18:47:24 -0000 Is 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. __Martin >>>>> On Mon, 22 Jun 2020 14:22:05 -0400, Mikhail T said: > > Gentlemen! > > An old bug in the patch is causing compiler-warnings, and leads to > erroneous behavior where pointers are bigger than 32-bit. > > Moreover, given the memcpy right after it, the bzero is simply not > needed at all. Instead of removing the bogus ampersand, the entire line > should be deleted. (I would've replaced the memcpy with an assignment > too, but that's not as pressing.) > > Can I commit this? > > Index: files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c > =================================================================== > --- 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 the >    * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. >    */ > @@ -466,7 +466,6 @@ >  + >  +      MNT_ILOCK(mp); >  +      mp->mnt_data = 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 |= MNT_LOCAL; > > Thanks. Yours, > > -mi > > _______________________________________________ > freebsd-emulation@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-emulation > To unsubscribe, send any mail to "freebsd-emulation-unsubscribe@freebsd.org" >