Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Apr 2021 17:47:57 +0200
From:      Alexander Lochmann <alexander.lochmann@tu-dortmund.de>
To:        freebsd-fs <freebsd-fs@freebsd.org>
Subject:   [struct mount] Unprotected access to mnt_secondary_writes
Message-ID:  <5d5cf8de-a262-f6f3-ee0c-6b7ff1a0f095@tu-dortmund.de>

next in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--VYJP1x4FZLDzgvCR6nLMdNSdTUpmJZwj9
Content-Type: multipart/mixed; boundary="YY1emT9VbRTPbiuIOjn771gtXiGOhohqH";
 protected-headers="v1"
From: Alexander Lochmann <alexander.lochmann@tu-dortmund.de>
To: freebsd-fs <freebsd-fs@freebsd.org>
Message-ID: <5d5cf8de-a262-f6f3-ee0c-6b7ff1a0f095@tu-dortmund.de>
Subject: [struct mount] Unprotected access to mnt_secondary_writes

--YY1emT9VbRTPbiuIOjn771gtXiGOhohqH
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable

Hi folks!

According to the documentation [1], and to our findings, mnt_mtx is used =

to protect mnt_secondary_writes in struct mount.
However, our data shows that it is accessed in vn_fsync_buf() [2]=20
without the mnt_mtx lock. I attached the stack trace at the end of this=20
mail.
Our data shows as well that the vnode.v_lock and the=20
vnode.v_bufobj.bo_lock are being held.
Is this a valid access that ignores the locking on purpose?
Or is it a bug?

Regards,
Alex

[1] https://github.com/freebsd/freebsd-src/blob/main/sys/sys/mount.h#L236=

[2]=20
https://github.com/freebsd/freebsd-src/blob/main/sys/kern/vfs_vnops.c#L28=
05

Stacktrace:
syscall
syscallenter
sys_nmount
vfs_donmount
vfs_domount
vfs_domount_update
ffs_mount
vfs_write_suspend_umnt
vfs_write_suspend
ffs_sync
softdep_flushworklist
VOP_FSYNC
vop_stdfsync
vn_fsync_buf

--=20
Technische Universit=C3=A4t Dortmund
Alexander Lochmann                PGP key: 0xBC3EF6FD
Otto-Hahn-Str. 16                 phone:  +49.231.7556141
D-44227 Dortmund                  fax:    +49.231.7556116
http://ess.cs.tu-dortmund.de/Staff/al


--YY1emT9VbRTPbiuIOjn771gtXiGOhohqH--

--VYJP1x4FZLDzgvCR6nLMdNSdTUpmJZwj9
Content-Type: application/pgp-signature; name="OpenPGP_signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="OpenPGP_signature"

-----BEGIN PGP SIGNATURE-----

wsF5BAABCAAjFiEElhZsUHzVP0dbkjCRWT7tBbw+9v0FAmBvJa4FAwAAAAAACgkQWT7tBbw+9v0A
2BAAlt+7pHahpz/ENZ5fG8RZLP4CzJhoIetFq6MFBfXkXW0vIjBqVR+Cq2TxJUPBbqZzg8SX99sS
caZY8zLluceruCILz2/Pw9twijv5P2f6opE+xVvSn1S+ygmBy5Mkohr/ZraQRNaefmNGrDqaEbTV
h2D+FN+cmLE8qNK/PNaG7lsk1VHea8oOag+toqybLVAo3uHM0cskLPVVDq33s3MuJseoJ/kHgd/y
npi9Pxbyhaksk3QWmJhKioSwqj7JrSwvCVW0xYh5p1CpKoeEbQXcq6El7MnpA2nwxxYaf/vtUMsK
j2pt6YsLejnv4RLYtbdG9ls2uzANtoYoYwhdXFYToZPiMXBXkE+SsznzmHeNmIEQFCqmnm0iTyDj
MWB7migNhZt3fjZKteuYCeAckowQUEOagDA0Ti0E6ySN9avkXbaVnl4h/cEsLOqB/AP7nIkfxTS3
echa0UT+LZ4OPxUD1PzNUkXwh7VEAY1n/VkYJ/8h3nqKjB559tdGaUl9QZSN6lanf+9OagewxJfP
6Z8TtCOkDHRRvY7sBJ4YTTIQKfbHqnO7KS1h5wLmwG/ekGgqHL0/RmWpmDXJ0BaGlJH3LtOJii6m
R26MuYoeYAONX93paSwudgtFOCRKQfddYzVfpzbSzaxMkEXa/EpYPeAnC7QPxBa0frx9u0xwFIY/
Mdg=
=5Uby
-----END PGP SIGNATURE-----

--VYJP1x4FZLDzgvCR6nLMdNSdTUpmJZwj9--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5d5cf8de-a262-f6f3-ee0c-6b7ff1a0f095>