Message ID | 20211201204118.3617544-1-mmakassikis@freebox.fr (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | ksmbd: Remove unused parameter from smb2_get_name() | expand |
Acked-by: Hyunchul Lee <hyc.lee@gmail.com> 2021년 12월 4일 (토) 오전 1:21, Marios Makassikis <mmakassikis@freebox.fr>님이 작성: > > The 'share' parameter is no longer used by smb2_get_name() since > commit 265fd1991c1d ("ksmbd: use LOOKUP_BENEATH to prevent the out of > share access"). > > Signed-off-by: Marios Makassikis <mmakassikis@freebox.fr> > --- > fs/ksmbd/smb2pdu.c | 13 ++++--------- > 1 file changed, 4 insertions(+), 9 deletions(-) > > diff --git a/fs/ksmbd/smb2pdu.c b/fs/ksmbd/smb2pdu.c > index 125590d5e940..1edb536fbf75 100644 > --- a/fs/ksmbd/smb2pdu.c > +++ b/fs/ksmbd/smb2pdu.c > @@ -610,7 +610,6 @@ static void destroy_previous_session(struct ksmbd_user *user, u64 id) > > /** > * smb2_get_name() - get filename string from on the wire smb format > - * @share: ksmbd_share_config pointer > * @src: source buffer > * @maxlen: maxlen of source string > * @nls_table: nls_table pointer > @@ -618,8 +617,7 @@ static void destroy_previous_session(struct ksmbd_user *user, u64 id) > * Return: matching converted filename on success, otherwise error ptr > */ > static char * > -smb2_get_name(struct ksmbd_share_config *share, const char *src, > - const int maxlen, struct nls_table *local_nls) > +smb2_get_name(const char *src, const int maxlen, struct nls_table *local_nls) > { > char *name; > > @@ -2513,8 +2511,7 @@ int smb2_open(struct ksmbd_work *work) > goto err_out1; > } > > - name = smb2_get_name(share, > - req->Buffer, > + name = smb2_get_name(req->Buffer, > le16_to_cpu(req->NameLength), > work->conn->local_nls); > if (IS_ERR(name)) { > @@ -5381,8 +5378,7 @@ static int smb2_rename(struct ksmbd_work *work, > goto out; > } > > - new_name = smb2_get_name(share, > - file_info->FileName, > + new_name = smb2_get_name(file_info->FileName, > le32_to_cpu(file_info->FileNameLength), > local_nls); > if (IS_ERR(new_name)) { > @@ -5493,8 +5489,7 @@ static int smb2_create_link(struct ksmbd_work *work, > if (!pathname) > return -ENOMEM; > > - link_name = smb2_get_name(share, > - file_info->FileName, > + link_name = smb2_get_name(file_info->FileName, > le32_to_cpu(file_info->FileNameLength), > local_nls); > if (IS_ERR(link_name) || S_ISDIR(file_inode(filp)->i_mode)) { > -- > 2.25.1 >
2021-12-02 5:41 GMT+09:00, Marios Makassikis <mmakassikis@freebox.fr>: > The 'share' parameter is no longer used by smb2_get_name() since > commit 265fd1991c1d ("ksmbd: use LOOKUP_BENEATH to prevent the out of > share access"). > > Signed-off-by: Marios Makassikis <mmakassikis@freebox.fr> Acked-by: Namjae Jeon <linkinjeon@kernel.org>
diff --git a/fs/ksmbd/smb2pdu.c b/fs/ksmbd/smb2pdu.c index 125590d5e940..1edb536fbf75 100644 --- a/fs/ksmbd/smb2pdu.c +++ b/fs/ksmbd/smb2pdu.c @@ -610,7 +610,6 @@ static void destroy_previous_session(struct ksmbd_user *user, u64 id) /** * smb2_get_name() - get filename string from on the wire smb format - * @share: ksmbd_share_config pointer * @src: source buffer * @maxlen: maxlen of source string * @nls_table: nls_table pointer @@ -618,8 +617,7 @@ static void destroy_previous_session(struct ksmbd_user *user, u64 id) * Return: matching converted filename on success, otherwise error ptr */ static char * -smb2_get_name(struct ksmbd_share_config *share, const char *src, - const int maxlen, struct nls_table *local_nls) +smb2_get_name(const char *src, const int maxlen, struct nls_table *local_nls) { char *name; @@ -2513,8 +2511,7 @@ int smb2_open(struct ksmbd_work *work) goto err_out1; } - name = smb2_get_name(share, - req->Buffer, + name = smb2_get_name(req->Buffer, le16_to_cpu(req->NameLength), work->conn->local_nls); if (IS_ERR(name)) { @@ -5381,8 +5378,7 @@ static int smb2_rename(struct ksmbd_work *work, goto out; } - new_name = smb2_get_name(share, - file_info->FileName, + new_name = smb2_get_name(file_info->FileName, le32_to_cpu(file_info->FileNameLength), local_nls); if (IS_ERR(new_name)) { @@ -5493,8 +5489,7 @@ static int smb2_create_link(struct ksmbd_work *work, if (!pathname) return -ENOMEM; - link_name = smb2_get_name(share, - file_info->FileName, + link_name = smb2_get_name(file_info->FileName, le32_to_cpu(file_info->FileNameLength), local_nls); if (IS_ERR(link_name) || S_ISDIR(file_inode(filp)->i_mode)) {
The 'share' parameter is no longer used by smb2_get_name() since commit 265fd1991c1d ("ksmbd: use LOOKUP_BENEATH to prevent the out of share access"). Signed-off-by: Marios Makassikis <mmakassikis@freebox.fr> --- fs/ksmbd/smb2pdu.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)