io_uring: io_grab_files() misses taking files->count?

From: Kirill Tkhai
Date: Thu Feb 06 2020 - 11:32:29 EST


Hi, Jens,

in io_grab_files() we take pointer to current->files without taking files->count.
Later, this files become attached to worker in io_worker_handle_work() also without
any manipulation with counter.

But files->count is used for different optimizations. Say, in expand_fdtable() we
avoid synchonize_rcu() in case of there is only files user. In case of there are
more users, missing of synchronize_rcu() is not safe.

Is this correct? Or maybe there is some hidden logic in io_uring, which prevents
this problem? Say, IORING_OP_OPENAT/CLOSE/ETC can't be propagated to worker etc...

Kirill