Re: [PATCH] fs/io_uring: fix O_PATH fds in openat, openat2, statx

From: Max Kellermann
Date: Thu May 07 2020 - 15:37:08 EST


On 2020/05/07 21:29, Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
> Again, resolving the descriptor more than once in course of syscall
> is almost always a serious bug;

.. and that is what Linux currently does for those three operation,
and yes, it's buggy. The generic preparation code looks up the fd,
but later in the implementation, only the numeric fd is used.

My patch removes this duplication, by removing the first lookup.

Max