Revision d856f32a86b2b015ab180ab7a55e455ed8d3ccc5 authored by Benjamin LaHaise on 24 August 2014, 17:14:05 UTC, committed by Linus Torvalds on 24 August 2014, 22:47:27 UTC
As reported by Dan Aloni, commit f8567a3845ac ("aio: fix aio request leak when events are reaped by userspace") introduces a regression when user code attempts to perform io_submit() with more events than are available in the ring buffer. Reverting that commit would reintroduce a regression when user space event reaping is used. Fixing this bug is a bit more involved than the previous attempts to fix this regression. Since we do not have a single point at which we can count events as being reaped by user space and io_getevents(), we have to track event completion by looking at the number of events left in the event ring. So long as there are as many events in the ring buffer as there have been completion events generate, we cannot call put_reqs_available(). The code to check for this is now placed in refill_reqs_available(). A test program from Dan and modified by me for verifying this bug is available at http://www.kvack.org/~bcrl/20140824-aio_bug.c . Reported-by: Dan Aloni <dan@kernelim.com> Signed-off-by: Benjamin LaHaise <bcrl@kvack.org> Acked-by: Dan Aloni <dan@kernelim.com> Cc: Kent Overstreet <kmo@daterainc.com> Cc: Mateusz Guzik <mguzik@redhat.com> Cc: Petr Matousek <pmatouse@redhat.com> Cc: stable@vger.kernel.org # v3.16 and anything that f8567a3845ac was backported to Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 451fd72
File | Mode | Size |
---|---|---|
apparmor | ||
integrity | ||
keys | ||
selinux | ||
smack | ||
tomoyo | ||
yama | ||
Kconfig | -rw-r--r-- | 5.7 KB |
Makefile | -rw-r--r-- | 913 bytes |
capability.c | -rw-r--r-- | 24.6 KB |
commoncap.c | -rw-r--r-- | 28.2 KB |
device_cgroup.c | -rw-r--r-- | 21.1 KB |
inode.c | -rw-r--r-- | 6.7 KB |
lsm_audit.c | -rw-r--r-- | 9.4 KB |
min_addr.c | -rw-r--r-- | 1.3 KB |
security.c | -rw-r--r-- | 36.3 KB |
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...