]> www.infradead.org Git - users/jedix/linux-maple.git/commit
uio: Prevent device destruction while fds are open
authorHamish Martin <hamish.martin@alliedtelesis.co.nz>
Wed, 13 Feb 2019 16:29:29 +0000 (16:29 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Feb 2019 07:09:14 +0000 (08:09 +0100)
commit085d735c858934e5d5bfaedb1fc98bd9135e6ff1
tree435a1d4dd78eaf453c33c7af23e95289c32a420c
parentcd4fe6339ccd9638da1304160abe60b84115dee5
uio: Prevent device destruction while fds are open

commit a93e7b331568227500186a465fee3c2cb5dffd1f upstream.

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>
[4.14 change __poll_t to unsigned int]
Signed-off-by: Tommi Rantala <tommi.t.rantala@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/uio/uio.c
include/linux/uio_driver.h