• Christian Brauner's avatar
    ksmbd: fix translation in create_posix_rsp_buf() · 3cdc20e7
    Christian Brauner authored
    When transferring ownership information to the client the k*ids are
    translated into raw *ids before they are sent over the wire. The
    function currently erroneously translates the k*ids according to the
    mount's idmapping. Instead, reporting the owning *ids to userspace the
    underlying k*ids need to be mapped up in the caller's user namespace.
    This is how stat() works.
    The caller in this instance is ksmbd itself and ksmbd always runs in the
    initial user namespace. Translate according to that taking any potential
    idmapped mounts into account.
    
    Switch to from_k*id_munged() which ensures that the overflow*id is
    returned instead of the (*id_t)-1 when the k*id can't be translated.
    
    Cc: Steve French <stfrench@microsoft.com>
    Cc: Christoph Hellwig <hch@infradead.org>
    Cc: Namjae Jeon <namjae.jeon@samsung.com>
    Cc: Hyunchul Lee <hyc.lee@gmail.com>
    Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
    Cc: linux-cifs@vger.kernel.org
    Signed-off-by: default avatarChristian Brauner <christian.brauner@ubuntu.com>
    Signed-off-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
    Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
    3cdc20e7
oplock.c 44.1 KB