tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: rwlock issue in secmodel



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, 27 Oct 2014 16:42:15 +0100
Maxime Villard <max%M00nBSD.net@localhost> wrote:

> Hi,
> I think there's a rwlock issue in secmodel/secmodel.c:
> 
> 174	if (sm == NULL) {
> 175		error = EFAULT;
> 176		goto out;
> 177	}
> 178
> 179	/* Check if the secmodel is already present. */
> 180	rw_enter(&secmodels_lock, RW_WRITER);
> ...
>   out:
> 194	/* Unlock the secmodels list. */
> 195	rw_exit(&secmodels_lock);
> 196
> 197	return error;
> 
> This goto out will release secmodels_lock while it is not yet held,
> right?
> 
> The same in secmodel_unplug().
> 

Yes, seems that way to me.
secmodel_plug is only called from secmodel_register, where it would
crash anyway if sm is NULL so it should be an assert, right?
(and for unplug the check should be in secmodel_deregister)

Lars


- -- 

Mystische Erklärungen:
Die mystischen Erklärungen gelten für tief;
die Wahrheit ist, dass sie noch nicht einmal oberflächlich sind.

   -- Friedrich Nietzsche
   [ Die Fröhliche Wissenschaft Buch 3, 126 ]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEARECAAYFAlROqUcACgkQcxuYqjT7GRbmygCdG3TDr1qQk0Lxepvq6ckr35FI
vGoAn2eYnPwNJo2qz41MLMkUFQdOiJqk
=ziPz
-----END PGP SIGNATURE-----


Home | Main Index | Thread Index | Old Index