Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 857585 - sys-kernel/gentoo-sources : impossible to mount CIFS since 5.18.9
Summary: sys-kernel/gentoo-sources : impossible to mount CIFS since 5.18.9
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL: https://patchwork.kernel.org/project/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-11 10:26 UTC by yesi
Modified: 2022-08-18 08:52 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
kernel.config from the client (config.kernel,189.85 KB, text/plain)
2022-07-13 10:17 UTC, yesi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description yesi 2022-07-11 10:26:26 UTC
Hi,

After a recent update of gentoo-sources from 5.18.7 to 5.18.10, i can't mount anymore CIFS share.

mount -t cifs -o username=${s_user},noexec,nosuid,nodev,user,rw,uid=${s_uid},gid=${s_gid},rootcontext=staff_u:object_r:cifs_t,fscontext=staff_u:object_r:cifs_t"

with, 5.18.7 : it works
with 5.18.9 and 5.18.9 :  it does not work anymore.

> /var/log/kern.log
CIFS: VFS: cifs_mount failed w/return code = -22

> emerge --info

Portage 3.0.30 (python 3.10.5-final-0, default/linux/amd64/17.1/hardened/selinux, gcc-11.3.0, glibc-2.34-r13, 5.18.10-gentoo x86_64)
=================================================================
System uname: Linux-5.18.10-gentoo-x86_64-Intel-R-_Core-TM-_i7-8705G_CPU_@_3.10GHz-with-glibc2.34
KiB Mem:    28248824 total,  22876764 free
KiB Swap:    8388604 total,   8388604 free
Timestamp of repository gentoo: Mon, 11 Jul 2022 00:45:01 +0000
Head commit of repository gentoo: 072baf809172a2d4280c7ea0c5cc6081eb29078e
sh bash 5.1_p16
ld GNU ld (Gentoo 2.37_p1 p2) 2.37
ccache version 4.5.1 [enabled]
app-misc/pax-utils:        1.3.4::gentoo
app-shells/bash:           5.1_p16::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.34.1-r3::gentoo
dev-lang/python:           2.7.18_p15::gentoo, 3.8.13_p2::gentoo, 3.9.13::gentoo, 3.10.5::gentoo
dev-lang/rust:             1.60.0::gentoo
dev-util/ccache:           4.5.1::gentoo
dev-util/cmake:            3.22.4::gentoo
dev-util/meson:            0.62.2::gentoo
sec-policy/selinux-base:   2.20220106-r3::gentoo
sys-apps/baselayout:       2.8::gentoo
sys-apps/openrc:           0.44.10::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-devel/autoconf:        2.71-r1::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.37_p1-r2::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/gcc:             11.3.0::gentoo
sys-devel/gcc-config:      2.5-r1::gentoo
sys-devel/libtool:         2.4.7::gentoo
sys-devel/llvm:            14.0.4::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/glibc:            2.34-r13::gentoo
sys-libs/libselinux:       3.4::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts:
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes

local
    location: /usr/local/portage
    masters: gentoo
    priority: 10

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=skylake -O2 -fforce-addr -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=skylake -O2 -fforce-addr -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--jobs=4 --load-average=4.0 --keep-going=y --with-bdeps=y --complete-graph"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg buildpkg-live ccache config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch parallel-install preserve-libs protect-owned qa-unresolved-soname-deps sandbox selinux sesandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://local"
LANG="fr_FR.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j8"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="X acl amd64 audit branding bzip2 caps chroot crypt cryptsetup elogind ffmpeg gnutls hardened iconv icu ipv6 jpeg libglvnd libtirpc logrotate lzma mmx modplug multilib ncurses nls nptl opengl openmp pam pax_kernel pcre perl pic pie png python readline seccomp secure_delete selinux snmp split-usr sse sse2 ssl ssp symlink unicode wavpack webrsync-gpg xattr xml xtpax zlib" ABI_X86="64" ADA_TARGET="gnat_2020" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="load memory syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" QEMU_SOFTMMU_TARGETS="arm x86_64 sparc" QEMU_USER_TARGETS="x86_64" RUBY_TARGETS="ruby27" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Alice Ferrazzi Gentoo Infrastructure gentoo-dev 2022-07-12 10:41:14 UTC
-22 error looks like to be a generic error for CIFS that is not helpful...
could you check the error logs on the server machine ?

Can you try to bisect the kernel?
Comment 2 Alice Ferrazzi Gentoo Infrastructure gentoo-dev 2022-07-12 10:42:01 UTC
also attach the kernel configuration
Comment 3 yesi 2022-07-13 10:17:36 UTC
Created attachment 791312 [details]
kernel.config from the client
Comment 4 yesi 2022-07-13 10:21:07 UTC
> could you check the error logs on the server machine ?

File server is a FreeBSD, with Active Directory authentification.
samba --version
Version 4.7.0


/var/log/samba4 # tail -f log.smbd
[2022/07/13 12:12:50.184573,  1] ../source3/smbd/service.c:521(make_connection_snum)
  create_connection_session_info failed: NT_STATUS_ACCESS_DENIED


> Can you try to bisect the kernel?
I do not understand.
Comment 5 Alice Ferrazzi Gentoo Infrastructure gentoo-dev 2022-07-13 11:52:25 UTC
can you try to use log level 10 on the smb server for looking better in detail why is failing the authentication.

also did you recently update samba server ? what version of the samba server are you using?
Comment 6 Alice Ferrazzi Gentoo Infrastructure gentoo-dev 2022-07-13 11:57:13 UTC
sorry just now I looked your smb version. 
4.7.x is really old and went EOL https://wiki.samba.org/index.php/Samba_Release_Planning

that's probably why recent CIFS is no more supporting it.
Comment 7 Alice Ferrazzi Gentoo Infrastructure gentoo-dev 2022-07-13 12:01:26 UTC
Re: kernel-5.18.8 breaks cifs mounts
related: https://lore.kernel.org/all/CAH2r5mv5bFG2tAEtbft-Zo+2jOqFfpr9B9TtWpgc5jhR-OiaZQ@mail.gmail.com
Comment 8 Alice Ferrazzi Gentoo Infrastructure gentoo-dev 2022-07-13 12:05:38 UTC
This is a samba problem not kernel problem 

here is the fix tested on 4.12.x
https://git.samba.org/?p=samba.git;a=commitdiff;h=147dd9d58a429695a3b6c6e45c8b0eaafc67908a
Comment 9 Martin Czernia 2022-07-14 19:29:23 UTC
I have the same problem. Seems to be a bug on older Samba servers. But the client stopped working. The server version did not changed for me.

I found a patch for the kernel:

https://patchwork.kernel.org/project/cifs-client/patch/CAH2r5mtuN-yswT5VTbNPzj02fwiHYOCe2eR8mcgRgRE8Qpkjgw@mail.gmail.com/
Comment 10 Alice Ferrazzi Gentoo Infrastructure gentoo-dev 2022-07-15 05:13:18 UTC
Testing patch on gentoo-sources 5.18.11

https://gkernelci.gentoo.org/#/builders/71/builds/14
Comment 11 Alice Ferrazzi Gentoo Infrastructure gentoo-dev 2022-07-15 05:16:07 UTC
as I have no old samba server around for testing the patch other than building it can you confirm that the patch solve the issue ?
Comment 12 Martin Czernia 2022-07-15 06:51:18 UTC
Yes, solved the issue. Tested with 5.8.11.
Comment 13 Alice Ferrazzi Gentoo Infrastructure gentoo-dev 2022-07-15 06:56:34 UTC
do you have any way of testing if works also with newer servers?
Comment 14 Martin Czernia 2022-07-15 07:55:35 UTC
I can provide the versions I have tested.

Log before:

Jul 11 21:03:05 ion kernel: CIFS: Attempting to mount \\fs01\home$
Jul 11 21:03:06 ion kernel: CIFS: Attempting to mount \\fs01\share
Jul 11 21:03:07 ion kernel: CIFS: Attempting to mount \\fs01\data$
Jul 11 21:03:07 ion kernel: CIFS: Attempting to mount \\gentoo\mczernia
Jul 11 21:03:08 ion kernel: CIFS: VFS: parse_server_interfaces: malformed interface info
Jul 11 21:03:08 ion kernel: CIFS: Attempting to mount \\debian7\mczernia
Jul 11 21:03:08 ion kernel: CIFS: Attempting to mount \\debian9\mczernia
Jul 11 21:03:08 ion kernel: CIFS: VFS: cifs_mount failed w/return code = -22
Jul 11 21:03:08 ion kernel: CIFS: Attempting to mount \\debian10\mczernia
Jul 11 21:03:09 ion kernel: CIFS: VFS: cifs_mount failed w/return code = -22
Jul 11 21:03:09 ion kernel: CIFS: Attempting to mount \\debian11\mczernia
Jul 11 21:03:09 ion kernel: CIFS: VFS: cifs_mount failed w/return code = -22


Log after:

Jul 15 08:28:34 ion kernel: CIFS: Attempting to mount \\fs01\home$
Jul 15 08:28:34 ion kernel: CIFS: Attempting to mount \\fs01\share
Jul 15 08:28:35 ion kernel: CIFS: Attempting to mount \\fs01\data$
Jul 15 08:28:35 ion kernel: CIFS: Attempting to mount \\gentoo\mczernia
Jul 15 08:28:35 ion kernel: CIFS: VFS: parse_server_interfaces: malformed interface info
Jul 15 08:28:35 ion kernel: CIFS: Attempting to mount \\debian7\mczernia
Jul 15 08:28:36 ion kernel: CIFS: Attempting to mount \\debian9\mczernia
Jul 15 08:28:37 ion kernel: CIFS: Attempting to mount \\debian10\mczernia
Jul 15 08:28:37 ion kernel: CIFS: Attempting to mount \\debian11\mczernia

Versions:

fs01: Windows Server
gentoo: 4.15.7
debian7: Version 4.1.17-Debian
debian9: Version 4.5.16-Debian
debian10: Version 4.9.5-Debian
debian11: Version 4.13.13-Debian

For gentoo I get a warning. But it worked before and after.
Comment 15 Alice Ferrazzi Gentoo Infrastructure gentoo-dev 2022-07-15 09:35:34 UTC
patch added to linux-patches

From ce587fbdb043f9ed6e28155265f2e2530d756a78 Mon Sep 17 00:00:00 2001
From: Alice Ferrazzi <alicef@gentoo.org>
Date: Fri, 15 Jul 2022 17:56:36 +0900
Subject: Add 1950_workaround_negprot_bug.patch

Fix incompatibility with older samba server

Signed-off-by: Alice Ferrazzi <alicef@gentoo.org>
---
 0000_README                       |  4 +++
 1950_workaround_negprot_bug.patch | 56 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+)
 create mode 100644 1950_workaround_negprot_bug.patch
Comment 16 yesi 2022-07-18 09:20:42 UTC
My workaround, i used this version option : vers=2.1 instead of none.
Comment 17 Alice Ferrazzi Gentoo Infrastructure gentoo-dev 2022-07-19 07:02:46 UTC
@yesi the CIFS patch as been added in gentoo-sources 5.18.12 can you test it? thanks
Comment 18 yesi 2022-08-18 08:52:36 UTC
@Alice
Sorry for the delay, it worked without option "vers=2.1".

Thanks.