Skip to content

Commit

Permalink
Merge tag 'v6.11-rc6-server-fixes' of git://git.samba.org/ksmbd
Browse files Browse the repository at this point in the history
Pull smb server fixes from Steve French:

 - Fix crash in session setup

 - Fix locking bug

 - Improve access bounds checking

* tag 'v6.11-rc6-server-fixes' of git://git.samba.org/ksmbd:
  ksmbd: Unlock on in ksmbd_tcp_set_interfaces()
  ksmbd: unset the binding mark of a reused connection
  smb: Annotate struct xattr_smb_acl with __counted_by()
  • Loading branch information
Linus Torvalds committed Sep 4, 2024
2 parents 4356ab3 + 844436e commit d8abb73
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions fs/smb/server/smb2pdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1690,6 +1690,8 @@ int smb2_sess_setup(struct ksmbd_work *work)
rc = ksmbd_session_register(conn, sess);
if (rc)
goto out_err;

conn->binding = false;
} else if (conn->dialect >= SMB30_PROT_ID &&
(server_conf.flags & KSMBD_GLOBAL_FLAG_SMB3_MULTICHANNEL) &&
req->Flags & SMB2_SESSION_REQ_FLAG_BINDING) {
Expand Down Expand Up @@ -1768,6 +1770,8 @@ int smb2_sess_setup(struct ksmbd_work *work)
sess = NULL;
goto out_err;
}

conn->binding = false;
}
work->sess = sess;

Expand Down
4 changes: 3 additions & 1 deletion fs/smb/server/transport_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,8 +624,10 @@ int ksmbd_tcp_set_interfaces(char *ifc_list, int ifc_list_sz)
for_each_netdev(&init_net, netdev) {
if (netif_is_bridge_port(netdev))
continue;
if (!alloc_iface(kstrdup(netdev->name, GFP_KERNEL)))
if (!alloc_iface(kstrdup(netdev->name, GFP_KERNEL))) {
rtnl_unlock();
return -ENOMEM;
}
}
rtnl_unlock();
bind_additional_ifaces = 1;
Expand Down
2 changes: 1 addition & 1 deletion fs/smb/server/xattr.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ struct xattr_acl_entry {
struct xattr_smb_acl {
int count;
int next;
struct xattr_acl_entry entries[];
struct xattr_acl_entry entries[] __counted_by(count);
};

/* 64bytes hash in xattr_ntacl is computed with sha256 */
Expand Down

0 comments on commit d8abb73

Please sign in to comment.