Skip to content

cifs: overhaul of auth selection code

Jeff Layton linux-cifs 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest19 patches 4 repliesIn review
  2. v119 patches 24 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/19cifs: remove protocolEnum definitionfs/cifs/cifsglob.h+0 -60 replies
2/19cifs: remove useless memset in LANMAN auth codefs/cifs/cifsencrypt.c+0 -10 replies
3/19cifs: make decode_ascii_ssetup void returnfs/cifs/sess.c+7 -110 replies
4/19cifs: throw a warning if negotiate or sess_setup ops are passed NULL server or session pointersfs/cifs/cifssmb.c fs/cifs/sess.c fs/cifs/smb2pdu.c+16 -190 replies
5/19cifs: remove the cifs_ses->flags fieldfs/cifs/cifsglob.h fs/cifs/connect.c fs/cifs/sess.c +1 more+7 -290 replies
6/19cifs: remove "seal" stubsfs/cifs/cifsfs.c fs/cifs/cifsglob.h fs/cifs/connect.c+3 -190 replies
7/19cifs: break out decoding of security blob into separate functionfs/cifs/cifspdu.h fs/cifs/cifssmb.c+62 -510 replies
8/19cifs: break out lanman NEGOTIATE handling into separate functionfs/cifs/cifssmb.c+97 -880 replies
9/19cifs: move handling of signed connections into separate functionfs/cifs/cifsproto.h fs/cifs/cifssmb.c fs/cifs/smb2pdu.c+40 -620 replies
10/19cifs: factor out check for extended security bit into separate functionfs/cifs/cifssmb.c+16 -90 replies
11/19cifs: add new "Unspecified" securityEnum valuefs/cifs/cifsglob.h+2 -20 replies
12/19cifs: track the flavor of the NEGOTIATE reponsefs/cifs/cifsglob.h fs/cifs/cifssmb.c fs/cifs/smb2pdu.c+16 -50 replies
13/19cifs: add new fields to smb_vol to track the requested security flavorfs/cifs/cifsglob.h fs/cifs/connect.c+27 -00 replies
14/19cifs: add new fields to cifs_ses to track requested security flavorfs/cifs/cifsfs.c fs/cifs/cifsglob.h fs/cifs/connect.c+13 -41 reply
15/19cifs: track the enablement of signing in the TCP_Server_Infofs/cifs/cifsglob.h fs/cifs/cifsproto.h fs/cifs/cifssmb.c +7 more+71 -820 replies
16/19cifs: move sectype to the cifs_ses instead of TCP_Server_Infofs/cifs/cifsencrypt.c fs/cifs/cifsglob.h fs/cifs/cifsproto.h +4 more+115 -1800 replies
17/19cifs: update the default global_secflags to include "raw" NTLMv2fs/cifs/cifsglob.h+1 -10 replies
18/19cifs: clean up the SecurityFlags write handlerfs/cifs/cifs_debug.c+14 -60 replies
19/19cifs: try to handle the MUST SecurityFlags sanelyfs/cifs/cifs_debug.c+28 -01 reply

Reviews trailers per patch

All 19 patches have a Reviewed-by or Acked-by.

PatchPavel Shilovsky
1/19A-b
2/19A-b
3/19A-b
4/19R-b
5/19A-b
6/19A-b
7/19A-b
8/19A-b
9/19R-b
10/19R-b
11/19R-b
12/19R-b
13/19R-b
14/19A-b
15/19R-b
16/19A-b
17/19R-b
18/19R-b
19/19R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/19] cifs: overhaul of auth selection code

This is the second version of this patchset. The changes from the last set are relatively minor:

- the LANMAN NEGOTIATE handling doesn't call cifs_enable_signing itself anymore. It now just returns back to CIFSSMBNegotiate which does it. This addresses Pavel's concern about calling "goto neg_err_exit" when there wasn't actually an error.

- the handling of signing code has been restructured a bit. The code now simply uses the ses->sectype and ses->sign fields to determine whether a particular sectype or signing mode was requested in the mount options. The actual determination about whether to use signing is made later.

Other than that, the patchset is essentially the same. Even though I've made some changes, I've left Pavel's Acked-by and Reviewed-by lines in place since they were pretty minor. Pavel, let me know if you want to rescind any of them.

I'd still like to see this go in for 3.11. Original cover letter follows:

--------------------[snip]------------------

When the change to make cifs default to NTLMSSP auth was made recently, it broke a number of working setups. If the server doesn't support extended security, then there is no way to recover. This is mostly due to the fact that CIFS handles the selection of the authentication to use badly. It makes that decision before ever talking to the server. If it guesses wrong, then there is no recourse.

At SambaXP this year, I also spoke with Simo Sorce about making cifs.ko talk directly to the new gssproxy daemon to handle GSSAPI auth. I think that would be a good thing to do. Doing that would allow us to get out of the ASN.1 parsing business for the most part, and allow cifs to support things like NegoEx. We can't reasonably support that though with the code as rickety as it is today.

This patchset represents an overhaul of how cifs.ko selects the type of authentication to use with the server. The idea here is to defer that decision until SESSION_SETUP time, so that we can make an intelligent decision about it based on the results of the NEGOTIATE.

The first several patches in the series represent some cleanup of dead and broken code and struct fields that are unused. Next, chunks of CIFSSMBNegotiate are factored out into helper functions. Next, we change how the auth selection is done, and do that using securityEnum values and a flag for signing, rather than trying to pass around variants of SecurityFlags.

Lastly, there are a couple of patches that try to bring some sanity to the SecurityFlags interface.

I'd like to see this merged for 3.11, so getting it into linux-next soon would be good. Once this is merged, we can start looking at how best to integrate gssproxy with cifs.ko as well.

Comments and suggestions welcome...

Jeff Layton (19):
cifs: remove protocolEnum definition
cifs: remove useless memset in LANMAN auth code
cifs: make decode_ascii_ssetup void return
cifs: throw a warning if negotiate or sess_setup ops are passed NULL
server or session pointers
cifs: remove the cifs_ses->flags field
cifs: remove "seal" stubs
cifs: break out decoding of security blob into separate function
cifs: break out lanman NEGOTIATE handling into separate function
cifs: move handling of signed connections into separate function
cifs: factor out check for extended security bit into separate
function
cifs: add new "Unspecified" securityEnum value
cifs: track the flavor of the NEGOTIATE reponse
cifs: add new fields to smb_vol to track the requested security flavor
cifs: add new fields to cifs_ses to track requested security flavor
cifs: track the enablement of signing in the TCP_Server_Info
cifs: move sectype to the cifs_ses instead of TCP_Server_Info
cifs: update the default global_secflags to include "raw" NTLMv2
cifs: clean up the SecurityFlags write handler
cifs: try to handle the MUST SecurityFlags sanely

 fs/cifs/cifs_debug.c    |  48 +++++-
 fs/cifs/cifsencrypt.c   |   5 +-
 fs/cifs/cifsfs.c        |  13 +-
 fs/cifs/cifsglob.h      |  35 ++--
 fs/cifs/cifspdu.h       |   4 +-
 fs/cifs/cifsproto.h     |   3 +
 fs/cifs/cifssmb.c       | 423 +++++++++++++++++++++++-------------------------
 fs/cifs/connect.c       | 155 +++++++-----------
 fs/cifs/misc.c          |   3 +-
 fs/cifs/sess.c          |  95 ++++++++---
 fs/cifs/smb1ops.c       |  21 +--
 fs/cifs/smb2pdu.c       | 114 ++++---------
 fs/cifs/smb2transport.c |   3 +-
 fs/cifs/transport.c     |   4 +-
 14 files changed, 443 insertions(+), 483 deletions(-)
Signature · 1 line
1.8.1.4