Re: [PATCH] fs/char_dev: fix cdev_put() vs f_op->release() use-after-free

2016-08-11 Thread Dan Williams
On Wed, Aug 10, 2016 at 10:16 PM, Al Viro wrote: > On Wed, Aug 10, 2016 at 09:49:22PM -0700, Dan Williams wrote: > >> Where dax_dev_release() is the f_op->release() method, and is >> implemented to simply drop the final references on our driver objects: >> >>

Re: [PATCH] fs/char_dev: fix cdev_put() vs f_op->release() use-after-free

2016-08-11 Thread Dan Williams
On Wed, Aug 10, 2016 at 10:16 PM, Al Viro wrote: > On Wed, Aug 10, 2016 at 09:49:22PM -0700, Dan Williams wrote: > >> Where dax_dev_release() is the f_op->release() method, and is >> implemented to simply drop the final references on our driver objects: >> >> struct dax_dev *dax_dev =

Re: [PATCH] fs/char_dev: fix cdev_put() vs f_op->release() use-after-free

2016-08-10 Thread Al Viro
On Wed, Aug 10, 2016 at 09:49:22PM -0700, Dan Williams wrote: > Where dax_dev_release() is the f_op->release() method, and is > implemented to simply drop the final references on our driver objects: > > struct dax_dev *dax_dev = filp->private_data; > struct device *dev =

Re: [PATCH] fs/char_dev: fix cdev_put() vs f_op->release() use-after-free

2016-08-10 Thread Al Viro
On Wed, Aug 10, 2016 at 09:49:22PM -0700, Dan Williams wrote: > Where dax_dev_release() is the f_op->release() method, and is > implemented to simply drop the final references on our driver objects: > > struct dax_dev *dax_dev = filp->private_data; > struct device *dev =

[PATCH] fs/char_dev: fix cdev_put() vs f_op->release() use-after-free

2016-08-10 Thread Dan Williams
drivers/dax/dax.c implements a character device that supports mmap(). While trying to convert it to use the cdev api a unit test started failing. The test effectively does the following to test that the driver revokes active mappings when the device is unregistered: fd = open("/dev/dax0.0",

[PATCH] fs/char_dev: fix cdev_put() vs f_op->release() use-after-free

2016-08-10 Thread Dan Williams
drivers/dax/dax.c implements a character device that supports mmap(). While trying to convert it to use the cdev api a unit test started failing. The test effectively does the following to test that the driver revokes active mappings when the device is unregistered: fd = open("/dev/dax0.0",