]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerTejun Heo <tj@kernel.org>
Wed, 14 Mar 2018 19:10:17 +0000 (12:10 -0700)
commitfe27ac2fadf70e40862f0be81c7d311bc8933e98
treefe5161b426a3c3071a9b3b5ee590af2ddd03e0d1
parentcf8f7c4d1aafea5fae3067aa5ecf20a5e0c2771d
fs/aio: Use RCU accessors for kioctx_table->table[]

While converting ioctx index from a list to a table, 32bf152f1acc
("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: 32bf152f1acc ("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+
fs/aio.c