{"id":2225216,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2225216/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-cifs-client/patch/aeZG4xhoMhYFSsIy@v4bel/","project":{"id":12,"url":"http://patchwork.ozlabs.org/api/1.1/projects/12/?format=json","name":"Linux CIFS Client","link_name":"linux-cifs-client","list_id":"linux-cifs.vger.kernel.org","list_email":"linux-cifs@vger.kernel.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<aeZG4xhoMhYFSsIy@v4bel>","date":"2026-04-20T15:31:47","name":"ksmbd: scope conn->binding slowpath to bound sessions only","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"3b690cb80b68d2194d5142c9bb8edad58c46fb9f","submitter":{"id":92809,"url":"http://patchwork.ozlabs.org/api/1.1/people/92809/?format=json","name":"Hyunwoo Kim","email":"imv4bel@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-cifs-client/patch/aeZG4xhoMhYFSsIy@v4bel/mbox/","series":[{"id":500629,"url":"http://patchwork.ozlabs.org/api/1.1/series/500629/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=500629","date":"2026-04-20T15:31:47","name":"ksmbd: scope conn->binding slowpath to bound sessions only","version":1,"mbox":"http://patchwork.ozlabs.org/series/500629/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2225216/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2225216/checks/","tags":{},"headers":{"Return-Path":"\n <linux-cifs+bounces-10943-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-cifs@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=D1D3ux0V;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-cifs+bounces-10943-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=\"D1D3ux0V\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.216.53","smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=gmail.com"],"Received":["from tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fzrWX6Mh5z1yGs\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 02:28:08 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 69BDD317530F\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 20 Apr 2026 15:32:16 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id F0EC3332601;\n\tMon, 20 Apr 2026 15:31:53 +0000 (UTC)","from mail-pj1-f53.google.com (mail-pj1-f53.google.com\n [209.85.216.53])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 10850330305\n\tfor <linux-cifs@vger.kernel.org>; Mon, 20 Apr 2026 15:31:51 +0000 (UTC)","by mail-pj1-f53.google.com with SMTP id\n 98e67ed59e1d1-35fc2b18363so3613795a91.0\n        for <linux-cifs@vger.kernel.org>;\n Mon, 20 Apr 2026 08:31:51 -0700 (PDT)","from v4bel ([58.123.110.97])\n        by smtp.gmail.com with ESMTPSA id\n d9443c01a7336-2b5fab32cfasm137381655ad.69.2026.04.20.08.31.48\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Mon, 20 Apr 2026 08:31:50 -0700 (PDT)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776699113; cv=none;\n b=a/F/J8on+1pxM+0s8v7NUyp3gSY/fC1hPn2tu6vbnaXaCXPEU/qXSEHtof444YpXgkYgyfhpOxIlhNz4rgC+/1PjiR7Kyu0iwrM2JdnHuBc58NbX57o+zksOq7Pe9R8KiDOcpgYoQ/eVxWkVhJ6vlnOxCsctOKQX8hoGdJkQi7o=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776699113; c=relaxed/simple;\n\tbh=fbaA+CF76pa0tdCSSLQ1fpW69I3/dJxzpN9EdEk9EKc=;\n\th=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type:\n\t Content-Disposition;\n b=XooP+V9BF9Q87Gw9qP1/D9gx9s7miCbKrqu/nVJ1cHXBK9emHaywI/6/AYimTo8OS/vF4Iz1RHRW2zsLtyWgqP3Rw9DN/cGVDo+T5b2RlewgVsMoMMtgGAjZwH72r7r1CkhV1WPXJ+TkN2ZD4mX90rUUXlYfC5AdAAIT7WiwU5k=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com;\n spf=pass smtp.mailfrom=gmail.com;\n dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=D1D3ux0V; arc=none smtp.client-ip=209.85.216.53","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20251104; t=1776699111; x=1777303911;\n darn=vger.kernel.org;\n        h=content-disposition:mime-version:message-id:subject:cc:to:from:date\n         :from:to:cc:subject:date:message-id:reply-to;\n        bh=TSTGycz2fpyX3ZiwKxX7KwYNacOqh5mj8y3fnHvG8kk=;\n        b=D1D3ux0VDMTUUdMOUSQMpDC2txFVRNKgcn8LyPhLAoCqiSQg3C8EDm3VkJq5pTH3e3\n         uEmFZHvuPDyVijEPTD2r+i/xuyGLctlm1ymBfKEynx0YMNx5RHw2XQ9g7EI4aJidFT9w\n         laqC6gb4g/Jy1Cztz5UW7Lx1t5zemdwV+WxQMLhcOnflwisLKMt6mAshjN/Y6lUU3Gw2\n         x/1HGR2vTYV6YTv2FM4w3pPdp/NNWflDDUmUnre9dEatujmWNIxAw+4Hg/dM5KQ4gtiV\n         VZay9xG7a7RDoQKqDFiFSyWuEGMlHDK4PqCt0r7kmEBlCvbhD3ZtU6UwgXD9UAmvw8ri\n         sevA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1776699111; x=1777303911;\n        h=content-disposition:mime-version:message-id:subject:cc:to:from:date\n         :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id\n         :reply-to;\n        bh=TSTGycz2fpyX3ZiwKxX7KwYNacOqh5mj8y3fnHvG8kk=;\n        b=W76cUYVSDjzddVvJhMEP5Zp6wBav/a04tl3KthOt1/4mbRWgIWrOOjefTZpj8I3GBh\n         bH6M0iKssf0RVY7gZ4F3+KVBXo3qbqRaAqQy3LeCGh6zrHd8ondRqAqXJ8Lal3nf1hdY\n         PPJwZnRiQZqg/st1JTr+Pl2zsvcA21yjh0AKy2hNgu7RqoJJAgb3hWSqJfObAb1OIiEw\n         /YlfBSwJlFzhM3mRAAnYZmZ6f14kkJUO+wRRkp534G8Cee2mua8Wfftddy36Hawnsdl/\n         +4S0dYNhB515w31cP7mncq5T+rSEIL5sJQILkbkYzLPC8W7uInIrG1kmCJpsqb2MrHVV\n         hkDg==","X-Gm-Message-State":"AOJu0Yxvyx+UinfBOXaIED1y3tUg06Ok+pYbkunQgp/rBXGgX2+8xB0b\n\tYZna6TDSbetCq9zgIU8CoNJP/y4LBLkT4RhtITbkaEV3Eu7vDeRA/oZQ","X-Gm-Gg":"AeBDiesBt8kbZYyGQxuf7qjcZ0Cwp+FC+xa5ZZD7m1OMVr43RMB494YN5cUXTfIeFVI\n\tOnHBH65nZ7QkO701X5OzhnSR/vfBVKVhJGslTfWUXUr1TrVndjVMdp/f7wts04O7v7LklrF9wOu\n\tLPFKCVrUPWEQydFJbAzACBw5ubbDqSuStoJAfEFsi2Q1Zb6Uf5UuRjuvGu+YfVUYNuWMof8E+oM\n\twUxbUuf7IVGJZnrYacymEYK7u/AOzcVB6crWCEhf7QEwEY9ilPOo9m3wvzmJaExERMtn3QxoKhV\n\t+Nf9EuCqPAszITqn2ME2uYLsfPEsNypA/WjfIQLBfnu8/QB7TLONAiwzRRiPS4W0vjvK2/tYjZi\n\t6rE6O+52JToS+c/zT8FNCkf/PADIjsY7i7LVfw1zGeh3I37/ou8AWbYiuY/rCV+LwrgymOTendA\n\tjT7mpvE9XqnQ8aOn08yLJvI3sHxYsPkzW9g4XKinV6mhEHw7lnlxKILA==","X-Received":"by 2002:a17:90b:2d8c:b0:35b:93d8:6aaa with SMTP id\n 98e67ed59e1d1-3614048b3f5mr13813502a91.19.1776699111313;\n        Mon, 20 Apr 2026 08:31:51 -0700 (PDT)","Date":"Tue, 21 Apr 2026 00:31:47 +0900","From":"Hyunwoo Kim <imv4bel@gmail.com>","To":"linkinjeon@kernel.org, smfrench@gmail.com, senozhatsky@chromium.org,\n\ttom@talpey.com","Cc":"linux-cifs@vger.kernel.org, imv4bel@gmail.com","Subject":"[PATCH] ksmbd: scope conn->binding slowpath to bound sessions only","Message-ID":"<aeZG4xhoMhYFSsIy@v4bel>","Precedence":"bulk","X-Mailing-List":"linux-cifs@vger.kernel.org","List-Id":"<linux-cifs.vger.kernel.org>","List-Subscribe":"<mailto:linux-cifs+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-cifs+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline"},"content":"When the binding SESSION_SETUP sets conn->binding = true, the flag stays\nset after the call so that the global session lookup in\nksmbd_session_lookup_all() can find the session, which was not added to\nconn->sessions. Because the flag is connection-wide, the global lookup\npath will also resolve any other session by id if asked.\n\nTighten the global lookup so that the returned session must have this\nconnection registered in its channel xarray (sess->ksmbd_chann_list).\nThe channel entry is installed by the existing binding_session path in\nntlm_authenticate()/krb5_authenticate() when a SESSION_SETUP completes\nsuccessfully, so this condition is a strict equivalent of \"this\nconnection has been accepted as a channel of this session\". Connections\nthat have not bound to a given session cannot reach it via the global\ntable.\n\nThe existing conn->binding gate for entering the slowpath is preserved\nso that non-binding connections keep the fast-path-only behavior, and\nthe session->state check is unchanged.\n\nFixes: f5a544e3bab7 (\"ksmbd: add support for SMB3 multichannel\")\nSigned-off-by: Hyunwoo Kim <imv4bel@gmail.com>\n---\n fs/smb/server/mgmt/user_session.c | 7 ++++++-\n 1 file changed, 6 insertions(+), 1 deletion(-)","diff":"diff --git a/fs/smb/server/mgmt/user_session.c b/fs/smb/server/mgmt/user_session.c\nindex a86589408835..ab8852da76f0 100644\n--- a/fs/smb/server/mgmt/user_session.c\n+++ b/fs/smb/server/mgmt/user_session.c\n@@ -547,8 +547,13 @@ struct ksmbd_session *ksmbd_session_lookup_all(struct ksmbd_conn *conn,\n \tstruct ksmbd_session *sess;\n \n \tsess = ksmbd_session_lookup(conn, id);\n-\tif (!sess && conn->binding)\n+\tif (!sess && conn->binding) {\n \t\tsess = ksmbd_session_lookup_slowpath(id);\n+\t\tif (sess && !xa_load(&sess->ksmbd_chann_list, (long)conn)) {\n+\t\t\tksmbd_user_session_put(sess);\n+\t\t\tsess = NULL;\n+\t\t}\n+\t}\n \tif (sess && sess->state != SMB2_SESSION_VALID) {\n \t\tksmbd_user_session_put(sess);\n \t\tsess = NULL;\n","prefixes":[]}