Re: [PATCH 1/3] smb/server: fix tree connection leak in smb2_tree_connect()

Namjae Jeon <[email protected]>
Newsgroups org.kernel.vger.linux-cifs
Message-ID <CAKYAXd8EEr8u9=gcn=D24DCLRWA2dPJCfc2-93qpe2eG2ix89w@mail.gmail.com>
On Fri, Aug 14, 2026 at 11:37 AM Ze Tan <[email protected]> wrote:
>
> See the procedure below:
>
>   smb2_tree_connect
>     ksmbd_tree_conn_connect
>       xa_store(&sess->tree_conns, tree_conn->id, tree_conn)
>       ksmbd_counter_inc(KSMBD_COUNTER_TREE_CONNS)
>       ksmbd_share_tree_conn_inc(sc)
>     ksmbd_iov_pin_rsp // fail
>     status.ret = KSMBD_TREE_CONN_STATUS_NOMEM
>     // do not disconnect tree_conn
>
> Disconnect the new tree connection if ksmbd_iov_pin_rsp() fails.
>
> Fixes: e2b76ab8b5c9 ("ksmbd: add support for read compound")
> Signed-off-by: Ze Tan <[email protected]>
> Reviewed-by: ChenXiaoSong <[email protected]>
Applied it to #ksmbd-for-next-next.
Thanks!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.