• Kees Cook's avatar
    fs: Move __scm_install_fd() to __receive_fd() · 66590610
    Kees Cook authored
    In preparation for users of the "install a received file" logic outside
    of net/ (pidfd and seccomp), relocate and rename __scm_install_fd() from
    net/core/scm.c to __receive_fd() in fs/file.c, and provide a wrapper
    named receive_fd_user(), as future patches will change the interface
    to __receive_fd().
    
    Additionally add a comment to fd_install() as a counterpoint to how
    __receive_fd() interacts with fput().
    
    Cc: Alexander Viro <viro@zeniv.linux.org.uk>
    Cc: "David S. Miller" <davem@davemloft.net>
    Cc: Jakub Kicinski <kuba@kernel.org>
    Cc: Dmitry Kadashev <dkadashev@gmail.com>
    Cc: Jens Axboe <axboe@kernel.dk>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Cc: Sargun Dhillon <sargun@sargun.me>
    Cc: Ido Schimmel <idosch@idosch.org>
    Cc: Ioana Ciornei <ioana.ciornei@nxp.com>
    Cc: linux-fsdevel@vger.kernel.org
    Cc: netdev@vger.kernel.org
    Reviewed-by: default avatarSargun Dhillon <sargun@sargun.me>
    Acked-by: default avatarChristian Brauner <christian.brauner@ubuntu.com>
    Signed-off-by: default avatarKees Cook <keescook@chromium.org>
    66590610
scm.c 8.29 KB