[SOLVED] Enable CONFIG_CIFS_SMB2 and CONFIG_CIFS_SMB311 on Linux 4.4.140
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Today I tried to backup to a cifs-mount at work via rsync and had no luck. The process (on the -current kernel 4.14.55) hung and I got nasty errors in my dmesg; basically as reported here: Weird kernel error with CIFS / general protection fault.
A workaround has been suggested here: bugs.archlinux.org/task/57474 where cifs option -vers=1.0 is proposed (instead of 3.0 or 2.1, which was the setting that worked before -- after reducing from 3.0 a while ago).
With the setting vers=1.0 for mount.cifs the backup went well. So maybe it is not only/immediately a kernel-configuration issue but more how mount.cifs is called?? And thus dependent on the settings of the (windows)server one connects to....?
I built and installed 4.4.142 today including CONFIG_CIFS_SMB2 and CONFIG_CIFS_SMB311 and I was going to try almost exactly what you did ... mount the Win10 PeeCee Share and pull the Data back to the Linux BackUp Box from the mounted CIFS directory.
I believe I'll put my scheduled testing off for a bit
Still, it doesn't look right, kjh. Was vers=1.0 not banned because of wannacry/petya vulnerabilities? Also, as 'duckgoing' just showed me, modern windows servers negotiate with the client what version to use:
Quote:
Please note that SMB clients and SMB servers negotiate the SMB dialect that they will use based on each side’s offer.
So maybe something is going wrong at our client-side (as the most recent changes were the -current kernel-updates at my end; last samba-update was in May).
Well, maybe your tests might be useful in the end. At the client-side you could vary the mount.cifs -o vers= to see whether your config changes allow negotiation of higher protocols without oopsing.. You might need to test with a big file though (mine were added up to over 10 Gb; which I was uploading with rsync to the windowes-share)
rob
Last edited by brobr; 07-20-2018 at 04:05 AM.
Reason: files were not over 1 gb each
Hi, I tested various dialect versions. At my work, from my slackware box with -current (4.14.55 or 56), no cifs-mount is possible with version 3 or over. With versions 2.0 or 2.1, or without any version given, mount works but rsync chokes immediately when trying to transfer files (So, not halfway or near the end). The general protection fault shows up in dmesg (see attached trace when trying with the 2.1 cifs-mount). After this, Thunar struggles and un-mounting the windows-share (as root) via umount needs the 'lazy' -l flag. Retrying another cifs-mount no longer works; a reboot is needed.
Same issue here as well. Recently decided to look into ditching protocol version 1.0 due to potential issues and that MS wants to deprecate it anyway.
Using rsync to run backups from windows onto a slackware system. With shares mounted with vers=1.0, everything is fine. With 2.0, 2.1, or 3.0, a simple 'ls' fails to list an item or two, rsync misses items. Issue is the same on both 64-14.2 and 64-current (20180718). vers=3.11 not yet tested, mount.cifs fails with that option despite kernel having been recompiled to add that option. Figure I need to check documentation and maybe recompile cifs-utils. Maybe after my second cup of coffee this morning.
Same here. Mounts fine, but the first write causes a segfault. Maybe something to do with these fixes. But I am too lazy to revert back to older kernel. Vers=1.0 works for now.
More information in case it's helpful, am using provided kernels on both 14.2 (4.4.132) and current (4.15.56). Server end is Win10-1803
Also, using shipped SlackBuild, upgraded cifs-tools on -current from 6.7 to 6.8, with vers=3.11 mount still fails with "Resource temporarily unavailable."
Nice Laptop btw ... I am a Sager / Clevo man, myself
-- kjh
Thanks; it's a good piece of kit; at our side of the Atlantic there is an OK company where you can configure the specs before ordering; good service as well; they replaced the screen after brownish sediment started to accumulate...
I've got a Windows 7 VMWare Machine running on my Work Laptop ( win7u ).
All I use it for is Outlook and GoTo Meetings for Work.
The Laptop is running 4.4.142 GENERIC including the following CIFS-related configs:
Code:
# grep CIFS /boot/config
CONFIG_CIFS=m
# CONFIG_CIFS_STATS is not set
CONFIG_CIFS_WEAK_PW_HASH=y
# CONFIG_CIFS_UPCALL is not set
# CONFIG_CIFS_XATTR is not set
CONFIG_CIFS_DEBUG=y
# CONFIG_CIFS_DEBUG2 is not set
CONFIG_CIFS_DFS_UPCALL=y
CONFIG_CIFS_SMB2=y
CONFIG_CIFS_SMB311=y
CONFIG_CIFS_FSCACHE=y
I shared the entire win7u C-Drive and mounted it as root on my Laptop like so ( note the vers=2.1 option )
Then I ran a couple read-from-win7u tests because the C-Drive ( only Drive ) on this VM is running low on space.
1. copy the largest win7u file that I can find to /dev/null on the linux box as 'me'.
NOTE: The test file is my Outlook .ost file so I closed Outlook on win7u because: 1) Outlook locks the file and 2) Outlook changes the file automatically as emails arrive.
Hi Konrad. FYI, the CIFS section of the -current64 config-4.14.56:
Quote:
CONFIG_CIFS=m
# CONFIG_CIFS_STATS is not set
CONFIG_CIFS_WEAK_PW_HASH=y
CONFIG_CIFS_UPCALL=y
CONFIG_CIFS_XATTR=y
CONFIG_CIFS_POSIX=y
CONFIG_CIFS_ACL=y
# CONFIG_CIFS_DEBUG is not set
CONFIG_CIFS_DFS_UPCALL=y
# CONFIG_CIFS_SMB311 is not set
CONFIG_CIFS_FSCACHE=y
Kernel 4.14.56 CIFS Docs are below my sig ... as ( I believe it was ) 55020 said, there is no longer a CONFIG_CIFS_SMB2 Variable.
I believe I read 'somewhere' that starting with 4.13.y that the default mount.cifs vers=2.0 ...
So another 4.4.142 + ( CONFIG_CIFS_SMB2=y ; CONFIG_CIFS_SMB311=y ) experiment.
I turned off SMB1 in Win7 ( see the attached picture for the Registry Key ).
Here is a handy little test script to mount my win7u Windows 7 share with varying option vers= settings ( ! YMWV ! ) :
Code:
#!/bin/sh
#
IPAddr="172.16.162.137" # edit me !
Share="//${IPAddr}/c" # edit me !
MtPt="/mnt/win7u" # edit me !
Version="2.1" # Max SMB Version for Windows 7 is 2.1
[ $# -gt 0 ] && Version="$1"
mount -v -t cifs $Share $MtPt -o "rw,uid=root,vers=${Version},forceuid,dir_mode=0777,file_mode=0666,noserverino,credentials=/root/.smbcred,ip=$IPAddr"
exit $?
I CANNOT mount with option vers=1.0
Code:
# mount-win7u 1.0 ; r=$? ; [ "$r" = "0" ] && df /mnt/win7u && umount /mnt/win7u ; echo -e "\n# RetCode = $r"
# invoking mount.cifs with option vers=1.0 ...
ip address 172.16.162.137 override specified
mount.cifs kernel mount options: ip=172.16.162.137,unc=\\172.16.162.137\c,vers=1.0,forceuid,dir_mode=0777,file_mode=0666,noserverino,uid=0,user=UUUUUUUU,pass=********
mount error(112): Host is down
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
# RetCode = 32
# NOTE: dmesg -w says:
[81964.428320] CIFS VFS: cifs_mount failed w/return code = -112
I CAN mount with option vers=2.0
Code:
# mount-win7u 2.0 ; r=$? ; [ "$r" = "0" ] && df /mnt/win7u && umount /mnt/win7u ; echo -e "\n# RetCode = $r"
# invoking mount.cifs with option vers=2.0 ...
ip address 172.16.162.137 override specified
mount.cifs kernel mount options: ip=172.16.162.137,unc=\\172.16.162.137\c,vers=2.0,forceuid,dir_mode=0777,file_mode=0666,noserverino,uid=0,user=UUUUUUUU,pass=********
Filesystem 1K-blocks Used Available Use% Mounted on
//172.16.162.137/c 157283324 122097952 35185372 78% /mnt/win7u
# RetCode = 0
# NOTE that dmesg -w said NOTHING
I CAN mount with option vers=2.1
Code:
# mount-win7u 2.1 ; r=$? ; [ "$r" = "0" ] && df /mnt/win7u && umount /mnt/win7u ; echo -e "\n# RetCode = $r"
# invoking mount.cifs with option vers=2.1 ...
ip address 172.16.162.137 override specified
mount.cifs kernel mount options: ip=172.16.162.137,unc=\\172.16.162.137\c,vers=2.1,forceuid,dir_mode=0777,file_mode=0666,noserverino,uid=0,user=UUUUUUUU,pass=********
Filesystem 1K-blocks Used Available Use% Mounted on
//172.16.162.137/c 157283324 122097952 35185372 78% /mnt/win7u
# RetCode = 0
# NOTE that dmesg -w said NOTHING
But Windows 7 cannot do vers=3.0 or 3.11:
Code:
# mount-win7u 3.0 ; r=$? ; [ "$r" = "0" ] && df /mnt/win7u && umount /mnt/win7u ; echo -e "\n# RetCode = $r"
# invoking mount.cifs with option vers=3.0 ...
ip address 172.16.162.137 override specified
mount.cifs kernel mount options: ip=172.16.162.137,unc=\\172.16.162.137\c,vers=3.0,forceuid,dir_mode=0777,file_mode=0666,noserverino,uid=0,user=UUUUUUUU,pass=********
mount error(95): Operation not supported
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
# RetCode = 32
# Note that dmesg -w said:
82119.413301] CIFS VFS: cifs_mount failed w/return code = -95
# -----------------------------------------------------------
# mount-win7u 3.11 ; r=$? ; [ "$r" = "0" ] && df /mnt/win7u && umount /mnt/win7u ; echo -e "\n# RetCode = $r"
# invoking mount.cifs with option vers=3.11 ...
ip address 172.16.162.137 override specified
mount.cifs kernel mount options: ip=172.16.162.137,unc=\\172.16.162.137\c,vers=3.11,forceuid,dir_mode=0777,file_mode=0666,noserverino,uid=0,user=UUUUUUUU,pass=********
mount error(95): Operation not supported
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
# RetCode = 32
# Note that dmesg -w said:
[82174.950198] CIFS VFS: cifs_mount failed w/return code = -95
I'll add some Disk Space to win7u for some write tests and then move on to win10 ...
-- kjh
These are the 4.14.56 CIFS Kernel Configs
Code:
config CIFS
tristate "SMB3 and CIFS support (advanced network filesystem)"
depends on INET
select NLS
select CRYPTO
select CRYPTO_MD4
select CRYPTO_MD5
select CRYPTO_SHA256
select CRYPTO_CMAC
select CRYPTO_HMAC
select CRYPTO_ARC4
select CRYPTO_AEAD2
select CRYPTO_CCM
select CRYPTO_ECB
select CRYPTO_AES
select CRYPTO_DES
help
This is the client VFS module for the SMB3 family of NAS protocols,
as well as for earlier dialects such as SMB2.1, SMB2 and the
Common Internet File System (CIFS) protocol. CIFS was the successor
to the original dialect, the Server Message Block (SMB) protocol, the
native file sharing mechanism for most early PC operating systems.
The SMB3 protocol is supported by most modern operating systems and
NAS appliances (e.g. Samba, Windows 8, Windows 2012, MacOS).
The older CIFS protocol was included in Windows NT4, 2000 and XP (and
later) as well by Samba (which provides excellent CIFS and SMB3
server support for Linux and many other operating systems). Limited
support for OS/2 and Windows ME and similar very old servers is
provided as well.
The cifs module provides an advanced network file system client
for mounting to SMB3 (and CIFS) compliant servers. It includes
support for DFS (hierarchical name space), secure per-user
session establishment via Kerberos or NTLM or NTLMv2,
safe distributed caching (oplock), optional packet
signing, Unicode and other internationalization improvements.
In general, the default dialects, SMB3 and later, enable better
performance, security and features, than would be possible with CIFS.
Note that when mounting to Samba, due to the CIFS POSIX extensions,
CIFS mounts can provide slightly better POSIX compatibility
than SMB3 mounts. SMB2/SMB3 mount options are also
slightly simpler (compared to CIFS) due to protocol improvements.
If you need to mount to Samba, Macs or Windows from this machine, say Y.
config CIFS_STATS
bool "CIFS statistics"
depends on CIFS
help
Enabling this option will cause statistics for each server share
mounted by the cifs client to be displayed in /proc/fs/cifs/Stats
config CIFS_STATS2
bool "Extended statistics"
depends on CIFS_STATS
help
Enabling this option will allow more detailed statistics on SMB
request timing to be displayed in /proc/fs/cifs/DebugData and also
allow optional logging of slow responses to dmesg (depending on the
value of /proc/fs/cifs/cifsFYI, see fs/cifs/README for more details).
These additional statistics may have a minor effect on performance
and memory utilization.
Unless you are a developer or are doing network performance analysis
or tuning, say N.
config CIFS_WEAK_PW_HASH
bool "Support legacy servers which use weaker LANMAN security"
depends on CIFS
help
Modern CIFS servers including Samba and most Windows versions
(since 1997) support stronger NTLM (and even NTLMv2 and Kerberos)
security mechanisms. These hash the password more securely
than the mechanisms used in the older LANMAN version of the
SMB protocol but LANMAN based authentication is needed to
establish sessions with some old SMB servers.
Enabling this option allows the cifs module to mount to older
LANMAN based servers such as OS/2 and Windows 95, but such
mounts may be less secure than mounts using NTLM or more recent
security mechanisms if you are on a public network. Unless you
have a need to access old SMB servers (and are on a private
network) you probably want to say N. Even if this support
is enabled in the kernel build, LANMAN authentication will not be
used automatically. At runtime LANMAN mounts are disabled but
can be set to required (or optional) either in
/proc/fs/cifs (see fs/cifs/README for more detail) or via an
option on the mount command. This support is disabled by
default in order to reduce the possibility of a downgrade
attack.
If unsure, say N.
config CIFS_UPCALL
bool "Kerberos/SPNEGO advanced session setup"
depends on CIFS && KEYS
select DNS_RESOLVER
help
Enables an upcall mechanism for CIFS which accesses userspace helper
utilities to provide SPNEGO packaged (RFC 4178) Kerberos tickets
which are needed to mount to certain secure servers (for which more
secure Kerberos authentication is required). If unsure, say Y.
config CIFS_XATTR
bool "CIFS extended attributes"
depends on CIFS
help
Extended attributes are name:value pairs associated with inodes by
the kernel or by users (see the attr(5) manual page, or visit
<http://acl.bestbits.at/> for details). CIFS maps the name of
extended attributes beginning with the user namespace prefix
to SMB/CIFS EAs. EAs are stored on Windows servers without the
user namespace prefix, but their names are seen by Linux cifs clients
prefaced by the user namespace prefix. The system namespace
(used by some filesystems to store ACLs) is not supported at
this time.
If unsure, say Y.
config CIFS_POSIX
bool "CIFS POSIX Extensions"
depends on CIFS_XATTR
help
Enabling this option will cause the cifs client to attempt to
negotiate a newer dialect with servers, such as Samba 3.0.5
or later, that optionally can handle more POSIX like (rather
than Windows like) file behavior. It also enables
support for POSIX ACLs (getfacl and setfacl) to servers
(such as Samba 3.10 and later) which can negotiate
CIFS POSIX ACL support. If unsure, say N.
config CIFS_ACL
bool "Provide CIFS ACL support"
depends on CIFS_XATTR && KEYS
help
Allows fetching CIFS/NTFS ACL from the server. The DACL blob
is handed over to the application/caller. See the man
page for getcifsacl for more information. If unsure, say Y.
config CIFS_DEBUG
bool "Enable CIFS debugging routines"
default y
depends on CIFS
help
Enabling this option adds helpful debugging messages to
the cifs code which increases the size of the cifs module.
If unsure, say Y.
config CIFS_DEBUG2
bool "Enable additional CIFS debugging routines"
depends on CIFS_DEBUG
help
Enabling this option adds a few more debugging routines
to the cifs code which slightly increases the size of
the cifs module and can cause additional logging of debug
messages in some error paths, slowing performance. This
option can be turned off unless you are debugging
cifs problems. If unsure, say N.
config CIFS_DEBUG_DUMP_KEYS
bool "Dump encryption keys for offline decryption (Unsafe)"
depends on CIFS_DEBUG
help
Enabling this will dump the encryption and decryption keys
used to communicate on an encrypted share connection on the
console. This allows Wireshark to decrypt and dissect
encrypted network captures. Enable this carefully.
If unsure, say N.
config CIFS_DFS_UPCALL
bool "DFS feature support"
depends on CIFS && KEYS
select DNS_RESOLVER
help
Distributed File System (DFS) support is used to access shares
transparently in an enterprise name space, even if the share
moves to a different server. This feature also enables
an upcall mechanism for CIFS which contacts userspace helper
utilities to provide server name resolution (host names to
IP addresses) which is needed for implicit mounts of DFS junction
points. If unsure, say Y.
config CIFS_NFSD_EXPORT
bool "Allow nfsd to export CIFS file system"
depends on CIFS && BROKEN
help
Allows NFS server to export a CIFS mounted share (nfsd over cifs)
config CIFS_SMB311
bool "SMB3.1.1 network file system support (Experimental)"
depends on CIFS
select CRYPTO_SHA512
help
This enables experimental support for the newest, SMB3.1.1, dialect.
This dialect includes improved security negotiation features.
If unsure, say N
config CIFS_FSCACHE
bool "Provide CIFS client caching support"
depends on CIFS=m && FSCACHE || CIFS=y && FSCACHE=y
help
Makes CIFS FS-Cache capable. Say Y here if you want your CIFS data
to be cached locally on disk through the general filesystem cache
manager. If unsure, say N.
Possibly the server I am connecting to at work runs windows 7 and not 8 or 10 which would explain that I could mount with cifs using dialect versions 2.0, 2.1 but not higher...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.