]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cifs: wrap received signature check in srv_mutex
authorJeff Layton <jlayton@redhat.com>
Sat, 2 Apr 2011 11:34:30 +0000 (07:34 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 21 Apr 2011 21:32:21 +0000 (14:32 -0700)
commit3b76dafa88d04ea91e9b16a4cd7489977d60602b
tree2268306c6fa4b2b14194ebdfeeadf7eeef43b3d4
parent591c80b5a9a9331a9b2a6d1b7d9b97d3445107c9
cifs: wrap received signature check in srv_mutex

commit 157c249114508aa71daa308a426e15d81a4eed00 upstream.

While testing my patchset to fix asynchronous writes, I hit a bunch
of signature problems when testing with signing on. The problem seems
to be that signature checks on receive can be running at the same
time as a process that is sending, or even that multiple receives can
be checking signatures at the same time, clobbering the same data
structures.

While we're at it, clean up the comments over cifs_calculate_signature
and add a note that the srv_mutex should be held when calling this
function.

This patch seems to fix the problems for me, but I'm not clear on
whether it's the best approach. If it is, then this should probably
go to stable too.

Cc: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/cifs/cifsencrypt.c