On Wed, Oct 05, 2016 at 01:02:34PM +0300, Jarkko Sakkinen wrote: > I'll repeat my question: what worse can happen than returning -EPIPE? I > though the whole rw lock scheme was introduced just for this purpose.
I thought I explained this, if device_del is moved after ops = null then if sysfs looses the race it will oops the kernel. device_del hard fences sysfs. > Why there's even that branch in tpm-dev.c if it's so bad to let it > happen? Because cdev_del and device_del do not guarentee that the cdev is fenced. They just prevent new calls into open(). So the branch in tpm-dev.c is necessary to avoid a kernel oops if user space holds the fd open across unregister. It is the same sitatuion you identified in the securityfs discussion - user space holding the fd open across a driver unregister. Jason ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ tpmdd-devel mailing list tpmdd-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tpmdd-devel