Re: [PATCH] ksmbd: exempt FSCTL_PIPE_TRANSCEIVE from the generic file-id lookup

ChenXiaoSong <[email protected]> Fri, 31 Jul 2026 20:23:52 +0800
Newsgroups org.kernel.vger.linux-cifs
Message-ID <[email protected]>
Tested-by: ChenXiaoSong <[email protected]>
Reviewed-by: ChenXiaoSong <[email protected]>

Before this patch:

     smbclient -m SMB3 -L 192.168.53.210 -U root
     Password for [WORKGROUP\root]:

             Sharename       Type      Comment
             ---------       ----      -------
     cli_rpc_pipe_open_noauth: rpc_pipe_bind for pipe srvsvc failed with 
error NT_STATUS_CONNECTION_DISCONNECTED
     SMB1 disabled -- no workgroup available

After this patch:

     smbclient -m SMB3 -L 192.168.53.210 -U root
     Password for [WORKGROUP\root]:

             Sharename       Type      Comment
             ---------       ----      -------
             test            Disk      content server share1
             ipc$            IPC       IPC share
             test2           Disk      content server share2
             test3           Disk      content server share3
     SMB1 disabled -- no workgroup available

在 2026/7/31 19:54, Gaël Blivet-Bailly 写道:
> From: Gael Blivet <[email protected]>
> 
> smb2_ioctl() rejects FSCTL_PIPE_TRANSCEIVE with
> STATUS_OBJECT_NAME_NOT_FOUND before fsctl_pipe_transceive() runs. RPC
> pipe IDs live in sess->rpc_handle_list, a separate namespace from the
> ksmbd_file table the generic ksmbd_lookup_fd_slow() gate searches, so
> the lookup always misses.
> 
> Found while testing generic SMB browsing (Finder's "Connect to
> Server"): every DCE/RPC bind over a named pipe (SRVSVC, WKSSVC, SAMR,
> LSARPC) failed right after CREATE. Adding FSCTL_PIPE_TRANSCEIVE to the
> same no_fileid_ioctl exemption as FSCTL_PIPE_WAIT fixes it, confirmed
> by testing a build with and without the change.
> 
> Fixes: 0726814421c2 ("ksmbd: add SMB3 request replay support")
> Signed-off-by: Gael Blivet <[email protected]>
> Assisted-by: Claude:claude-sonnet-5
> ---
>   fs/smb/server/smb2pdu.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
> index 4bde5ab..8d6f42b 100644
> --- a/fs/smb/server/smb2pdu.c
> +++ b/fs/smb/server/smb2pdu.c
> @@ -10133,6 +10133,7 @@ int smb2_ioctl(struct ksmbd_work *work)
>   	case FSCTL_QUERY_NETWORK_INTERFACE_INFO:
>   	case FSCTL_VALIDATE_NEGOTIATE_INFO:
>   	case FSCTL_PIPE_WAIT:
> +	case FSCTL_PIPE_TRANSCEIVE:
>   		no_fileid_ioctl = true;
>   		break;
>   	default:

-- 
ChenXiaoSong <[email protected]>
Chinese Homepage: https://chenxiaosong.com
English Homepage: https://chenxiaosong.com/en