mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-13 12:49:35 +02:00
ksmbd: fix potential circular locking issue in smb2_set_ea()
smb2_set_ea() can be called in parent inode lock range. So add get_write argument to smb2_set_ea() not to call nested mnt_want_write(). Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
bb05367a66
commit
6fc0a265e1
|
@ -2311,11 +2311,12 @@ out:
|
||||||
* @eabuf: set info command buffer
|
* @eabuf: set info command buffer
|
||||||
* @buf_len: set info command buffer length
|
* @buf_len: set info command buffer length
|
||||||
* @path: dentry path for get ea
|
* @path: dentry path for get ea
|
||||||
|
* @get_write: get write access to a mount
|
||||||
*
|
*
|
||||||
* Return: 0 on success, otherwise error
|
* Return: 0 on success, otherwise error
|
||||||
*/
|
*/
|
||||||
static int smb2_set_ea(struct smb2_ea_info *eabuf, unsigned int buf_len,
|
static int smb2_set_ea(struct smb2_ea_info *eabuf, unsigned int buf_len,
|
||||||
const struct path *path)
|
const struct path *path, bool get_write)
|
||||||
{
|
{
|
||||||
struct mnt_idmap *idmap = mnt_idmap(path->mnt);
|
struct mnt_idmap *idmap = mnt_idmap(path->mnt);
|
||||||
char *attr_name = NULL, *value;
|
char *attr_name = NULL, *value;
|
||||||
|
@ -3003,7 +3004,7 @@ int smb2_open(struct ksmbd_work *work)
|
||||||
|
|
||||||
rc = smb2_set_ea(&ea_buf->ea,
|
rc = smb2_set_ea(&ea_buf->ea,
|
||||||
le32_to_cpu(ea_buf->ccontext.DataLength),
|
le32_to_cpu(ea_buf->ccontext.DataLength),
|
||||||
&path);
|
&path, false);
|
||||||
if (rc == -EOPNOTSUPP)
|
if (rc == -EOPNOTSUPP)
|
||||||
rc = 0;
|
rc = 0;
|
||||||
else if (rc)
|
else if (rc)
|
||||||
|
@ -5992,7 +5993,7 @@ static int smb2_set_info_file(struct ksmbd_work *work, struct ksmbd_file *fp,
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
return smb2_set_ea((struct smb2_ea_info *)req->Buffer,
|
return smb2_set_ea((struct smb2_ea_info *)req->Buffer,
|
||||||
buf_len, &fp->filp->f_path);
|
buf_len, &fp->filp->f_path, true);
|
||||||
}
|
}
|
||||||
case FILE_POSITION_INFORMATION:
|
case FILE_POSITION_INFORMATION:
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user