linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Bartlett <abartlet@samba.org>
To: ronnie sahlberg <ronniesahlberg@gmail.com>,
	Ard Biesheuvel <ardb@kernel.org>
Cc: Eric Biggers <ebiggers@kernel.org>,
	linux-cifs <linux-cifs@vger.kernel.org>,
	Steve French <sfrench@samba.org>,
	"samba-technical@lists.samba.org"
	<samba-technical@lists.samba.org>,
	Linux Crypto Mailing List <linux-crypto@vger.kernel.org>
Subject: Re: Building cifs.ko without any support for insecure crypto?
Date: Thu, 19 Aug 2021 15:53:11 +1200	[thread overview]
Message-ID: <b8befda31438d4717ddd86e8c9e051264bf108b2.camel@samba.org> (raw)
In-Reply-To: <CAN05THS27h9QFpNuVVQmqz8k8_SKD8V8TbzZVYxco7S86i0zWA@mail.gmail.com>

On Thu, 2021-08-19 at 13:43 +1000, ronnie sahlberg via samba-technical
wrote:
> On Wed, Aug 18, 2021 at 9:44 PM Ard Biesheuvel <ardb@kernel.org>
> wrote:
> > On Tue, 17 Aug 2021 at 00:19, Eric Biggers <ebiggers@kernel.org>
> > wrote:
> > > On Sun, Aug 15, 2021 at 08:38:23PM +1000, ronnie sahlberg wrote:
> > > > What are the plans here? To just offer the possibility to
> > > > disable all
> > > > these old crypto and hashes on a local kernel compile?
> > > > Or is the plan to just outright remove it from the kernel
> > > > sources?
> > > > 
> > > > If the first, I think that could possible be done for cifs. I
> > > > think a
> > > > lot of the security minded larger enterprises already may be
> > > > disabling
> > > > both SMB1 and also NTLM on serverside, so they would be fine.
> > > > 
> > > > For the latter, I think it would be a no-go since aside from
> > > > krb5
> > > > there are just no other viable authentication mechs for smb.
> > > 
> > > Removing the code would be best, but allowing it to be compiled
> > > out would be the
> > > next best thing.
> > > 
> > > > TL;DR
> > > > If NTLMSSP authentication is disabled, there are no other
> > > > options to
> > > > map a share than using KRB5
> > > > and setting up the krb5 infrastructure. And thus smaller sites
> > > > will
> > > > not be able to use CIFS :-(
> > > > So while I think it is feasible to add support to cifs.ko to
> > > > conditionally disable features depending in a kernel compile
> > > > (no SMB1
> > > > if des/rc4 is missing, no NTLM if rc4/md4/md5 is missing)  I
> > > > don't
> > > > think it is feasible to disable these by default.
> > > > I will work on making it possible to build cifs.ko with limied
> > > > functionality when these algorithms are disabled though.
> > > 
> > > FWIW, the way this came up is that the Compatibility Test Suite
> > > for Android 11
> > > verifies that CONFIG_CRYPTO_MD4 isn't set.  The reason that test
> > > got added is
> > > because for a short time, CONFIG_CRYPTO_MD4 had accidentally been
> > > enabled in the
> > > recommended kernel config for Android.  Since "obviously" no one
> > > would be using
> > > a completely broken crypto algorithm from 31 years ago, when
> > > fixing that bug we
> > > decided to go a bit further and just forbid it from the kernel
> > > config.
> > > 
> > > I guess we'll have to remove that test for now (assuming that
> > > CONFIG_CIFS is to
> > > be allowed at all on an Android device, and that the people who
> > > want to use it
> > > don't want to use kerberos which is probably the case).
> > > 
> > > It is beyond ridiculous that this is even an issue though, given
> > > that MD4 has
> > > been severely compromised for over 25 years.
> > > 
> > > One thing which we should seriously consider doing is removing
> > > md4 from the
> > > crypto API and moving it into fs/cifs/.  It isn't a valid crypto
> > > algorithm, so
> > > anyone who wants to use it should have to maintain it themselves.
> > > 
> > 
> > +1 to moving the md4 code into fs/cifs, so that the CIFS
> > maintainers
> > can own it and phase it out on their own schedule, and prevent its
> > inadvertent use in other places.
> 
> Ok, let me summarize the status and what I think we will need to do
> in cifs.
> 
> DES
> ---
> Removal of DES is not controversial since this only affects SMB1.
> SMB2 has been around since 2006 and it is starting to become viable
> to at least
> disable the SMB1 protocol by default today.
> There are still servers that only support SMB1 but they are becoming
> rare.
> I think also Microsoft Windows default to disable (but not remove)
> SMB1 by default
> on some configurations today.
> 
> I am proposing that we remove the hard dependency to DES and instead
> make it a soft dependency to "do not build SMB1 if DES is missing".

NTLMSSP is also used over SMB1 (and presumably in cifs.ko), allowing
NTLMv2.  This means you would only need DES with 'bare' NTLM, which
means you are talking to a very, very old server, eg NT4 or Win9X, or
are running old crypto for giggles. 

Andrew Bartlett

-- 
Andrew Bartlett (he/him)       https://samba.org/~abartlet/
Samba Team Member (since 2001) https://samba.org
Samba Team Lead, Catalyst IT   https://catalyst.net.nz/services/samba

Samba Development and Support, Catalyst IT - Expert Open Source
Solutions


  reply	other threads:[~2021-08-19  3:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-13  3:23 Building cifs.ko without any support for insecure crypto? Eric Biggers
2021-08-13  4:46 ` ronnie sahlberg
2021-08-13 20:19   ` Eric Biggers
2021-08-15 10:38     ` ronnie sahlberg
2021-08-16 22:19       ` Eric Biggers
2021-08-17  5:35         ` Steve French
2021-08-18 11:44         ` Ard Biesheuvel
2021-08-19  3:43           ` ronnie sahlberg
2021-08-19  3:53             ` Andrew Bartlett [this message]
2021-08-23 10:04             ` Simo Sorce
2021-08-24 16:41               ` Steve French

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b8befda31438d4717ddd86e8c9e051264bf108b2.camel@samba.org \
    --to=abartlet@samba.org \
    --cc=ardb@kernel.org \
    --cc=ebiggers@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=ronniesahlberg@gmail.com \
    --cc=samba-technical@lists.samba.org \
    --cc=sfrench@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).