Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Aug 2021 10:59:26 +0200
From:      Alexander Lochmann <alexander.lochmann@tu-dortmund.de>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        freebsd-fs <freebsd-fs@freebsd.org>, Horst Schirmeier <horst@schirmeier.de>
Subject:   Re: Various unprotected accesses to buf and vnode
Message-ID:  <e50f4583-5150-a162-e188-7207e5e7eb61@tu-dortmund.de>
In-Reply-To: <YSq42Cb48SMv%2BsIO@kib.kiev.ua>
References:  <55f3661e-2173-793e-4834-bbcd79d3d99e@tu-dortmund.de> <YSkxgXyXZfNvrXA/@kib.kiev.ua> <380bdcc8-bede-2a64-8e5e-031552231d82@tu-dortmund.de> <YSqhe3WI8dVvUq7g@kib.kiev.ua> <46649402-d28a-6f81-f0a8-39180b681f4c@tu-dortmund.de> <YSq42Cb48SMv%2BsIO@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--TrAMUIRx3yG1tw1cZYcEB1sM5XQ6fCWrv
Content-Type: multipart/mixed; boundary="kshoIbYCUKWHwEeU7Nzqi78mBDHA0VuOS";
 protected-headers="v1"
From: Alexander Lochmann <alexander.lochmann@tu-dortmund.de>
To: Konstantin Belousov <kostikbel@gmail.com>
Cc: freebsd-fs <freebsd-fs@freebsd.org>,
 Horst Schirmeier <horst@schirmeier.de>
Message-ID: <e50f4583-5150-a162-e188-7207e5e7eb61@tu-dortmund.de>
Subject: Re: Various unprotected accesses to buf and vnode
References: <55f3661e-2173-793e-4834-bbcd79d3d99e@tu-dortmund.de>
 <YSkxgXyXZfNvrXA/@kib.kiev.ua>
 <380bdcc8-bede-2a64-8e5e-031552231d82@tu-dortmund.de>
 <YSqhe3WI8dVvUq7g@kib.kiev.ua>
 <46649402-d28a-6f81-f0a8-39180b681f4c@tu-dortmund.de>
 <YSq42Cb48SMv+sIO@kib.kiev.ua>
In-Reply-To: <YSq42Cb48SMv+sIO@kib.kiev.ua>

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

On 29.08.21 00:29, Konstantin Belousov wrote:
> Ok, I see some call sequences (?), but again all of them are ffs_write(=
)
> (one is ext2_write) calling into cluster_write().  There the buffer loc=
k
> is owned.
>=20
> Show me the specific call sequence where it is not.
Who owns the buffer lock at that point? Has its ownership been
transferred to the kernel?
Do you know where the buffer lock is acquired?

According to our data, the buffer lock of the current accessed buffer is
not owned. Otherwise, there would an entry like this
'EMBSAME(buf.b_lock[w])'.
So in all of those call sequences the buffer lock is not acquired.
However, I'd not rule out that our tooling could be broken as well.

> Ah, yes, the calls from lookup and open would be with the shared lock.
> Still, we lock the vnode interlock to avoid double-allocating the v_obj=
ect
> object, so it is fine.  Some mode of the vnode lock is required nonethe=
less,
> because otherwise we might miss reclaim which guarantees that v_object =

> is freed.
>=20
I see. Does this rule apply to all fields for which the vnode lock is
the designated lock?
=46rom a different angle:
The documentation says about bo_object: ''v' is the vnode lock which
embeds the bufobj.'.
Does 'the vnode lock' mean a specific lock, or a group of locks?

--=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


--kshoIbYCUKWHwEeU7Nzqi78mBDHA0VuOS--

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

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

wsF5BAABCAAjFiEElhZsUHzVP0dbkjCRWT7tBbw+9v0FAmEt724FAwAAAAAACgkQWT7tBbw+9v1b
xRAAqUWm+2aCjYoj0iNxaI4E9njrOPn6IQbWgtggp3wmqUq8csTvwyTEiBXtrJGFDwL62B0M4m9C
jjCvGZsIAXW5+VGy5B8CZQ2FzasC2L6GamLejjLAFIhG5fSDpjVCNU9DipdziLPutK+CQcL4/9Xi
U9iyAmGwIdt8ps4FE7sKS0gD3ndvYUHbZZOtn2lPlxZNIpnd7xaQJuSFpMaFW8RVE1cm4ZYtVvle
Ylh5lTkjehogSzFhV6Wv2pMTubX+j4N7JvOE9nZKh8iHc0kuKmF5HNXW5d3vesuIJNAK0Wg5ZKDu
9072JrhnE6Ll6DNySXRBTXFQMDwt4YDT9yt1wE8d4yS+OfAu7c8O2Bs/taNpiJ057fw0odmi1/jK
CUu+5Urvix6mnmcJrdeYV1wBer2o2Wm6Irm2Qm4wZ3ouaxi/MkJKGkSPtwhh9SoG2eMx4jY4a+Eg
O9zFdHiKsI+rfr9sQytn7avmMIgPCep6oDMe44x8/jF2V+DULm1lAZzvsQyRxAoDenGzQ0BiDib9
NpqiGLTUScKRcOsTxnoQ/5zMayvbODwnKyEDAlmWvMXmUbDvc1e0Vw38ucBWYdZmRGc11aKwC/zw
+8jiDKhjD2z7e3BTeTN8Kc8q/CTFboumbaHv299ZqeC29iQIVAnQNEkp3xZQ/z/JHmaW9LWaioxO
9BQ=
=bTT2
-----END PGP SIGNATURE-----

--TrAMUIRx3yG1tw1cZYcEB1sM5XQ6fCWrv--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?e50f4583-5150-a162-e188-7207e5e7eb61>