LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] cifs: fix MUST SecurityFlags filtering
@ 2015-01-22 13:16 Niklas Cassel
  2015-01-27  1:40 ` Steve French
  0 siblings, 1 reply; 2+ messages in thread
From: Niklas Cassel @ 2015-01-22 13:16 UTC (permalink / raw)
  To: sfrench; +Cc: linux-cifs, samba-technical, linux-kernel, Niklas Cassel

If CONFIG_CIFS_WEAK_PW_HASH is not set, CIFSSEC_MUST_LANMAN
and CIFSSEC_MUST_PLNTXT is defined as 0.

When setting new SecurityFlags without any MUST flags,
your flags would be overwritten with CIFSSEC_MUST_LANMAN (0).

Signed-off-by: Niklas Cassel <niklass@axis.com>
---
 fs/cifs/cifs_debug.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
index 9c56ef7..7febcf2 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -606,9 +606,11 @@ cifs_security_flags_handle_must_flags(unsigned int *flags)
 		*flags = CIFSSEC_MUST_NTLMV2;
 	else if ((*flags & CIFSSEC_MUST_NTLM) == CIFSSEC_MUST_NTLM)
 		*flags = CIFSSEC_MUST_NTLM;
-	else if ((*flags & CIFSSEC_MUST_LANMAN) == CIFSSEC_MUST_LANMAN)
+	else if (CIFSSEC_MUST_LANMAN &&
+		 (*flags & CIFSSEC_MUST_LANMAN) == CIFSSEC_MUST_LANMAN)
 		*flags = CIFSSEC_MUST_LANMAN;
-	else if ((*flags & CIFSSEC_MUST_PLNTXT) == CIFSSEC_MUST_PLNTXT)
+	else if (CIFSSEC_MUST_PLNTXT &&
+		 (*flags & CIFSSEC_MUST_PLNTXT) == CIFSSEC_MUST_PLNTXT)
 		*flags = CIFSSEC_MUST_PLNTXT;
 
 	*flags |= signflags;
-- 
2.1.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] cifs: fix MUST SecurityFlags filtering
  2015-01-22 13:16 [PATCH] cifs: fix MUST SecurityFlags filtering Niklas Cassel
@ 2015-01-27  1:40 ` Steve French
  0 siblings, 0 replies; 2+ messages in thread
From: Steve French @ 2015-01-27  1:40 UTC (permalink / raw)
  To: Niklas Cassel
  Cc: Steve French, linux-cifs, samba-technical, LKML, Niklas Cassel

merged into cifs-2.6.git

On Thu, Jan 22, 2015 at 7:16 AM, Niklas Cassel <niklas.cassel@axis.com> wrote:
> If CONFIG_CIFS_WEAK_PW_HASH is not set, CIFSSEC_MUST_LANMAN
> and CIFSSEC_MUST_PLNTXT is defined as 0.
>
> When setting new SecurityFlags without any MUST flags,
> your flags would be overwritten with CIFSSEC_MUST_LANMAN (0).
>
> Signed-off-by: Niklas Cassel <niklass@axis.com>
> ---
>  fs/cifs/cifs_debug.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
> index 9c56ef7..7febcf2 100644
> --- a/fs/cifs/cifs_debug.c
> +++ b/fs/cifs/cifs_debug.c
> @@ -606,9 +606,11 @@ cifs_security_flags_handle_must_flags(unsigned int *flags)
>                 *flags = CIFSSEC_MUST_NTLMV2;
>         else if ((*flags & CIFSSEC_MUST_NTLM) == CIFSSEC_MUST_NTLM)
>                 *flags = CIFSSEC_MUST_NTLM;
> -       else if ((*flags & CIFSSEC_MUST_LANMAN) == CIFSSEC_MUST_LANMAN)
> +       else if (CIFSSEC_MUST_LANMAN &&
> +                (*flags & CIFSSEC_MUST_LANMAN) == CIFSSEC_MUST_LANMAN)
>                 *flags = CIFSSEC_MUST_LANMAN;
> -       else if ((*flags & CIFSSEC_MUST_PLNTXT) == CIFSSEC_MUST_PLNTXT)
> +       else if (CIFSSEC_MUST_PLNTXT &&
> +                (*flags & CIFSSEC_MUST_PLNTXT) == CIFSSEC_MUST_PLNTXT)
>                 *flags = CIFSSEC_MUST_PLNTXT;
>
>         *flags |= signflags;
> --
> 2.1.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-27  1:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-22 13:16 [PATCH] cifs: fix MUST SecurityFlags filtering Niklas Cassel
2015-01-27  1:40 ` Steve French

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).