Skip to content

cifs: fix oopses and mem corruption with concurrent mount/umount (try #3)

Jeff Layton lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4cifs: clean up server protocol handling for TCP_Server_Infofs/cifs/cifsglob.h fs/cifs/connect.c+19 -280 replies
2/4cifs: handle the TCP_Server_Info->tsk field more carefullyfs/cifs/connect.c+28 -130 replies
3/4cifs: disable sharing session and tcon and add new TCP sharing codefs/cifs/cifs_debug.c fs/cifs/cifsfs.c fs/cifs/cifsglob.h +3 more+81 -1410 replies
4/4cifs: reinstate sharing of SMB sessionsfs/cifs/cifs_debug.c fs/cifs/cifsfs.c fs/cifs/cifsglob.h +4 more+137 -1250 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] cifs: fix oopses and mem corruption with concurrent mount/umount (try #3)

This patchset is intended to fix the oopses, memory corruption and mount failures when using the reproducer detailed here:

https://bugzilla.samba.org/show_bug.cgi?id=5720

This is the third attempt at this. Since the second attempt, Steve has committed the patch to remove kthread_stop from the cifsd shutdown codepath. That will fix the deadlocks, but opens the window wider for the oopses and memory corruption in this code.

The main difference in the remaining patches is that this set combines the patches that disable the structure sharing with the one that re-enables the TCP session sharing. It also adds a new patch that re-enables the sharing of SMB sessions. With this set, only tree connections are no longer shared.

With this, I've been able to run the reproducer in the above BZ for several hours, whereas before it would regularly crash after just a few minutes.

Jeff Layton (4):
cifs: clean up server protocol handling for TCP_Server_Info
cifs: handle the TCP_Server_Info->tsk field more carefully
cifs: disable sharing session and tcon and add new TCP sharing code
cifs: reinstate sharing of SMB sessions

 fs/cifs/cifs_debug.c |   54 ++++----
 fs/cifs/cifsfs.c     |   25 +++--
 fs/cifs/cifsglob.h   |   20 +--
 fs/cifs/cifssmb.c    |   20 +---
 fs/cifs/connect.c    |  354 +++++++++++++++++++++++---------------------------
 fs/cifs/misc.c       |   15 +--
 6 files changed, 223 insertions(+), 265 deletions(-)