Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use IPC$ access by host name while host name length are 8 and 9 connection create will fail. the tree connect response compare by the normal miss some part. my config way is guest access #593

Open
realszx opened this issue Jun 22, 2023 · 6 comments

Comments

@realszx
Copy link

realszx commented Jun 22, 2023

No description provided.

@realszx
Copy link
Author

realszx commented Jun 27, 2023

the root cause is host name length is 8 or 9, while do srvsvc will happen nla_put fail in message request to userspace.

@realszx
Copy link
Author

realszx commented Jun 27, 2023

static int ipc_msg_send(struct ksmbd_ipc_msg *msg)
{
struct genlmsghdr *nlh;
struct sk_buff *skb;
int ret = -EINVAL;

     if (!ksmbd_tools_pid) 
             return ret; 

     skb = genlmsg_new(msg->sz, GFP_KERNEL); 
     if (!skb) 
             return -ENOMEM; 

     nlh = genlmsg_put(skb, 0, 0, &ksmbd_genl_family, 0, msg->type); 
     if (!nlh) 
             goto out; 

     ret = nla_put(skb, msg->type, msg->sz, msg->payload); 
     if (ret) { 
             genlmsg_cancel(skb, nlh); 
             goto out; 
     } 

     genlmsg_end(skb, nlh); 
     ret = genlmsg_unicast(&init_net, skb, ksmbd_tools_pid); 
     if (!ret) 
             ipc_update_last_active(); 
     return ret; 

out:
nlmsg_free(skb);
return ret;
}

@namjaejeon
Copy link
Member

@realszx Can you send a pull request to fix this ?

@realszx
Copy link
Author

realszx commented Jul 3, 2023

@namjaejeon thanks to reply, I'm not sure the tmp fix is reasonable or not. tmp fix is skb = genlmsg_new(msg->sz + 4, GFP_KERNEL). I guess it is a pad length calculte error. final root cause is not clear, I still need trace.

@namjaejeon
Copy link
Member

namjaejeon commented Jul 4, 2023

@realszx Can you help me reproduce this issue ? can you share your smb.conf ?

@realszx
Copy link
Author

realszx commented Jul 12, 2023

IMG_20230712_145031.jpg

config file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants