]> git.baikalelectronics.ru Git - kernel.git/commit
uio: Prevent device destruction while fds are open
authorHamish Martin <hamish.martin@alliedtelesis.co.nz>
Mon, 14 May 2018 01:32:23 +0000 (13:32 +1200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 May 2018 14:16:35 +0000 (16:16 +0200)
commit6917e48509c8466b47f7f82cc80c1be5084296c0
tree9eb90315fad535118c90264d2d1d189913bbfe9b
parent18d45b717b0018dd012b0cb37354b72847fa4262
uio: Prevent device destruction while fds are open

Prevent destruction of a uio_device while user space apps hold open
file descriptors to that device. Further, access to the 'info' member
of the struct uio_device is protected by spinlock. This is to ensure
stale pointers to data not under control of the UIO subsystem are not
dereferenced.

Signed-off-by: Hamish Martin <hamish.martin@alliedtelesis.co.nz>
Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/uio/uio.c
include/linux/uio_driver.h