]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - fs/aio.c
fs/aio: Use RCU accessors for kioctx_table->table[]
authorTejun Heo <tj@kernel.org>
Wed, 14 Mar 2018 19:10:17 +0000 (12:10 -0700)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Wed, 21 Mar 2018 16:40:23 +0000 (13:40 -0300)
commit93a92586c1e18c12491e31e0132cb3e64a03fa2a
treeed4303191cac844181b96ad280509ba4783f076c
parent92b0bbf6f777ab6e288c61b59b19f3d6f547c76f
fs/aio: Use RCU accessors for kioctx_table->table[]

BugLink: http://bugs.launchpad.net/bugs/1757465
commit d0264c01e7587001a8c4608a5d1818dba9a4c11a upstream.

While converting ioctx index from a list to a table, db446a08c23d
("aio: convert the ioctx list to table lookup v3") missed tagging
kioctx_table->table[] as an array of RCU pointers and using the
appropriate RCU accessors.  This introduces a small window in the
lookup path where init and access may race.

Mark kioctx_table->table[] with __rcu and use the approriate RCU
accessors when using the field.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Jann Horn <jannh@google.com>
Fixes: db446a08c23d ("aio: convert the ioctx list to table lookup v3")
Cc: Benjamin LaHaise <bcrl@kvack.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: stable@vger.kernel.org # v3.12+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
fs/aio.c