Commit 5ee0e962603ef7d41d8e6581963c8557501dfcad
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6
Pull cifs fixes from Steve French: "Three small cifs fixes. One fixes a hang under stress, and the other two are security related" * 'for-next' of git://git.samba.org/sfrench/cifs-2.6: cifs: fix MUST SecurityFlags filtering Complete oplock break jobs before closing file handle cifs: use memzero_explicit to clear stack buffer
Showing 3 changed files Side-by-side Diff
fs/cifs/cifs_debug.c
... | ... | @@ -606,9 +606,11 @@ |
606 | 606 | *flags = CIFSSEC_MUST_NTLMV2; |
607 | 607 | else if ((*flags & CIFSSEC_MUST_NTLM) == CIFSSEC_MUST_NTLM) |
608 | 608 | *flags = CIFSSEC_MUST_NTLM; |
609 | - else if ((*flags & CIFSSEC_MUST_LANMAN) == CIFSSEC_MUST_LANMAN) | |
609 | + else if (CIFSSEC_MUST_LANMAN && | |
610 | + (*flags & CIFSSEC_MUST_LANMAN) == CIFSSEC_MUST_LANMAN) | |
610 | 611 | *flags = CIFSSEC_MUST_LANMAN; |
611 | - else if ((*flags & CIFSSEC_MUST_PLNTXT) == CIFSSEC_MUST_PLNTXT) | |
612 | + else if (CIFSSEC_MUST_PLNTXT && | |
613 | + (*flags & CIFSSEC_MUST_PLNTXT) == CIFSSEC_MUST_PLNTXT) | |
612 | 614 | *flags = CIFSSEC_MUST_PLNTXT; |
613 | 615 | |
614 | 616 | *flags |= signflags; |
fs/cifs/file.c
... | ... | @@ -366,6 +366,7 @@ |
366 | 366 | struct cifsLockInfo *li, *tmp; |
367 | 367 | struct cifs_fid fid; |
368 | 368 | struct cifs_pending_open open; |
369 | + bool oplock_break_cancelled; | |
369 | 370 | |
370 | 371 | spin_lock(&cifs_file_list_lock); |
371 | 372 | if (--cifs_file->count > 0) { |
... | ... | @@ -397,7 +398,7 @@ |
397 | 398 | } |
398 | 399 | spin_unlock(&cifs_file_list_lock); |
399 | 400 | |
400 | - cancel_work_sync(&cifs_file->oplock_break); | |
401 | + oplock_break_cancelled = cancel_work_sync(&cifs_file->oplock_break); | |
401 | 402 | |
402 | 403 | if (!tcon->need_reconnect && !cifs_file->invalidHandle) { |
403 | 404 | struct TCP_Server_Info *server = tcon->ses->server; |
... | ... | @@ -408,6 +409,9 @@ |
408 | 409 | server->ops->close(xid, tcon, &cifs_file->fid); |
409 | 410 | _free_xid(xid); |
410 | 411 | } |
412 | + | |
413 | + if (oplock_break_cancelled) | |
414 | + cifs_done_oplock_break(cifsi); | |
411 | 415 | |
412 | 416 | cifs_del_pending_open(&open); |
413 | 417 |