kernel: ksmbd: browse-interfaces-list-on-FSCTL_QUERY_INTERFACE_INFO
authorAndrea Pesaresi <[email protected]>
Sat, 11 Oct 2025 08:07:42 +0000 (10:07 +0200)
committerHauke Mehrtens <[email protected]>
Wed, 15 Oct 2025 21:39:33 +0000 (23:39 +0200)
backport from kernel 6.12

ksmbd.mount will give each interfaces list and bind_interfaces_only flags
to ksmbd server. Previously, the interfaces list was sent only
when bind_interfaces_only was enabled.
ksmbd server browse only interfaces list given from ksmbd.conf on
FSCTL_QUERY_INTERFACE_INFO IOCTL.

Signed-off-by: Andrea Pesaresi <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20377
Signed-off-by: Hauke Mehrtens <[email protected]>
target/linux/generic/backport-6.6/540-v6.12-ksmbd-browse-interfaces-list-on-FSCTL_QUERY_INTERFACE_INFO.patch [new file with mode: 0644]

diff --git a/target/linux/generic/backport-6.6/540-v6.12-ksmbd-browse-interfaces-list-on-FSCTL_QUERY_INTERFACE_INFO.patch b/target/linux/generic/backport-6.6/540-v6.12-ksmbd-browse-interfaces-list-on-FSCTL_QUERY_INTERFACE_INFO.patch
new file mode 100644 (file)
index 0000000..3c24f63
--- /dev/null
@@ -0,0 +1,35 @@
+From 0fc403192dcc8def1f6284959141608ac4c86699 Mon Sep 17 00:00:00 2001
+From: Namjae Jeon <[email protected]>
+Date: Fri, 10 Jan 2025 13:37:05 +0900
+Subject: ksmbd: browse interfaces list on FSCTL_QUERY_INTERFACE_INFO IOCTL
+
+[ Upstream commit b2d99376c5d61eb60ffdb6c503e4b6c8f9712ddd ]
+
+ksmbd.mount will give each interfaces list and bind_interfaces_only flags
+to ksmbd server. Previously, the interfaces list was sent only
+when bind_interfaces_only was enabled.
+ksmbd server browse only interfaces list given from ksmbd.conf on
+FSCTL_QUERY_INTERFACE_INFO IOCTL.
+
+Signed-off-by: Namjae Jeon <[email protected]>
+Signed-off-by: Steve French <[email protected]>
+Stable-dep-of: 21a4e47578d4 ("ksmbd: fix use-after-free in __smb2_lease_break_noti()")
+Signed-off-by: Sasha Levin <[email protected]>
+---
+ fs/smb/server/ksmbd_netlink.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+(limited to 'fs/smb/server/ksmbd_netlink.h')
+
+--- a/fs/smb/server/ksmbd_netlink.h
++++ b/fs/smb/server/ksmbd_netlink.h
+@@ -108,7 +108,8 @@ struct ksmbd_startup_request {
+       __u32   smb2_max_credits;       /* MAX credits */
+       __u32   smbd_max_io_size;       /* smbd read write size */
+       __u32   max_connections;        /* Number of maximum simultaneous connections */
+-      __u32   reserved[126];          /* Reserved room */
++      __s8    bind_interfaces_only;
++      __s8    reserved[503];          /* Reserved room */
+       __u32   ifc_list_sz;            /* interfaces list size */
+       __s8    ____payload[];
+ };