mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
smb3: missing lock when picking channel
[ Upstream commit 8094a600245e9b28eb36a13036f202ad67c1f887 ]
Coverity spotted a place where we should have been holding the
channel lock when accessing the ses channel index.
Addresses-Coverity: 1582039 ("Data race condition (MISSING_LOCK)")
Cc: stable@vger.kernel.org
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ff03a8b422
commit
98c7ed29cd
@@ -1079,9 +1079,11 @@ struct TCP_Server_Info *cifs_pick_channel(struct cifs_ses *ses)
|
|||||||
index = (uint)atomic_inc_return(&ses->chan_seq);
|
index = (uint)atomic_inc_return(&ses->chan_seq);
|
||||||
index %= ses->chan_count;
|
index %= ses->chan_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
server = ses->chans[index].server;
|
||||||
spin_unlock(&ses->chan_lock);
|
spin_unlock(&ses->chan_lock);
|
||||||
|
|
||||||
return ses->chans[index].server;
|
return server;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|||||||
Reference in New Issue
Block a user