Bug 238958 - net/samba410: smbd exits on signal 8 when used as Time machine target
Summary: net/samba410: smbd exits on signal 8 when used as Time machine target
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Timur I. Bakeyev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-03 14:26 UTC by Felix J. Ogris
Modified: 2020-04-12 19:36 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (timur)


Attachments
vfs_fruit does not check if there are no bands and divides by zero if the directory is empty (438 bytes, patch)
2020-04-12 19:36 UTC, Felix J. Ogris
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Felix J. Ogris 2019-07-03 14:26:32 UTC
smbd exits with SIGFPE on 12.0-RELEASE amd64 when a Mac tries to store Time machine backups:
pid 84975 (smbd), uid 65534: exited on signal 8

Output when started in debug mode:

# smbd -i -S -d 3
smbd version 4.10.5 started.
Copyright Andrew Tridgell and the Samba Team 1992-2019
uid=0 gid=0 euid=0 egid=0
lp_load_ex: refreshing parameters
Initialising global parameters
Processing section "[global]"
Registered MSG_REQ_POOL_USAGE
Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
lp_load_ex: refreshing parameters
Initialising global parameters
Processing section "[global]"
Processing section "[zamba]"
adding IPC service
added interface vtnet0 ip=192.168.0.3 bcast=192.168.0.255 netmask=255.255.255.0
loaded services
INFO: Profiling support unavailable in this build.
Failed to fetch domain sid for MILOSCH
file_init_global: Information only: requested 57870 open files, 57830 are available.
Initialise the svcctl registry keys if needed.
Initialise the eventlog registry keys if needed.
reloading printcap cache
pcap_cache_reload: skipping reload - load printers disabled
reloading printcap cache
pcap_cache_reload: skipping reload - load printers disabled
waiting for connections
Allowed connection from fjo-mbp.intra.ogris.net (192.168.0.14)
init_oplocks: initializing messages.
Transaction 0 of length 106 (0 toread)
Selected protocol SMB3_02
GENSEC backend 'gssapi_spnego' registered
GENSEC backend 'gssapi_krb5' registered
GENSEC backend 'gssapi_krb5_sasl' registered
GENSEC backend 'spnego' registered
GENSEC backend 'schannel' registered
GENSEC backend 'naclrpc_as_system' registered
GENSEC backend 'sasl-EXTERNAL' registered
GENSEC backend 'ntlmssp' registered
GENSEC backend 'ntlmssp_resume_ccache' registered
GENSEC backend 'http_basic' registered
GENSEC backend 'http_ntlm' registered
GENSEC backend 'http_negotiate' registered
Got NTLMSSP neg_flags=0x62880205
Got user=[GUEST] domain=[] workstation=[FJO-MBP] len1=24 len2=250
lp_load_ex: refreshing parameters
Initialising global parameters
Processing section "[global]"
Processing section "[zamba]"
adding IPC service
check_ntlm_password:  Checking password for unmapped user []\[GUEST]@[FJO-MBP] with the new password interface
check_ntlm_password:  mapped user is: []\[GUEST]@[FJO-MBP]
check_sam_security: Couldn't find user 'GUEST' in passdb.
check_ntlm_password:  Authentication for user [GUEST] -> [GUEST] FAILED with error NT_STATUS_NO_SUCH_USER, authoritative=1
Auth: [SMB2,(null)] user []\[GUEST] at [Wed, 03 Jul 2019 16:20:53.529686 CEST] with [NTLMv2] status [NT_STATUS_NO_SUCH_USER] workstation [FJO-MBP] remote host [ipv4:192.168.0.14:53184] mapped to []\[GUEST]. local host [ipv4:192.168.0.3:445] 
{"timestamp": "2019-07-03T16:20:53.530457+0200", "type": "Authentication", "Authentication": {"version": {"major": 1, "minor": 1}, "eventId": 4625, "logonType": 3, "status": "NT_STATUS_NO_SUCH_USER", "localAddress": "ipv4:192.168.0.3:445", "remoteAddress": "ipv4:192.168.0.14:53184", "serviceDescription": "SMB2", "authDescription": null, "clientDomain": "", "clientAccount": "GUEST", "workstation": "FJO-MBP", "becameAccount": null, "becameDomain": null, "becameSid": null, "mappedAccount": "GUEST", "mappedDomain": "", "netlogonComputer": null, "netlogonTrustAccount": null, "netlogonNegotiateFlags": "0x00000000", "netlogonSecureChannelType": 0, "netlogonTrustAccountSid": null, "passwordType": "NTLMv2", "duration": 8043}}
No such user GUEST [] - using guest account
Allowed connection from fjo-mbp.intra.ogris.net (192.168.0.14)
make_connection_snum: Connect path is '/zamba' for service [zamba]
Initialising default vfs hooks
Initialising custom vfs hooks from [/[Default VFS]/]
Initialising custom vfs hooks from [fruit]
load_module_absolute_path: Module '/usr/local/lib/samba4/modules/vfs/fruit.so' loaded
fruit_connect: Enabling durable handles for Time Machine support on [zamba]
fjo-mbp (ipv4:192.168.0.14:53184) connect to service zamba initially as user nobody (uid=65534, gid=65534) (pid 84996)
smbd_do_qfsinfo: level = 1003
nobody opened file /zamba/870265E5-6B47-570E-A302-AEFFB92130F2.sparsebundle/Info.plist read=Yes write=No (numopen=2)
nobody closed file /zamba/870265E5-6B47-570E-A302-AEFFB92130F2.sparsebundle/Info.plist (numopen=1) NT_STATUS_OK
Floating point exception

smb4.conf snippet:

        vfs objects = fruit

        fruit:model = Xserve
        fruit:resource = xattr
        fruit:metadata = stream

; globally writeable shares
[zamba]
        guest ok = yes
        hide dot files = no
        path = /zamba
        read only = no
        use sendfile = no
        fruit:time machine = yes
        fruit:time machine max size = 200G

Happens also when using a named tm instead of the guest account.
Same config runs fine with samba48.
Built samba410 from latest ports. /var/db/ports/net_samba410/options:

# This file is auto-generated by 'make config'.
# Options for samba410-4.10.5
_OPTIONS_READ=samba410-4.10.5
_FILE_COMPLETE_OPTIONS_LIST=ADS AD_DC AESNI CLUSTER CUPS DEBUG DEVELOPER DOCS FAM GLUSTERFS GPGME LDAP MANDOC NTVFS PROFILE QUOTAS SPOTLIGHT SYSLOG UTMP GSSAPI_BUILTIN GSSAPI_MIT NSUPDATE BIND911 BIND913 BIND914 MDNSRESPONDER AVAHI
OPTIONS_FILE_UNSET+=ADS
OPTIONS_FILE_UNSET+=AD_DC
OPTIONS_FILE_SET+=AESNI
OPTIONS_FILE_UNSET+=CLUSTER
OPTIONS_FILE_UNSET+=CUPS
OPTIONS_FILE_UNSET+=DEBUG
OPTIONS_FILE_UNSET+=DEVELOPER
OPTIONS_FILE_UNSET+=DOCS
OPTIONS_FILE_UNSET+=FAM
OPTIONS_FILE_UNSET+=GLUSTERFS
OPTIONS_FILE_UNSET+=GPGME
OPTIONS_FILE_UNSET+=LDAP
OPTIONS_FILE_UNSET+=MANDOC
OPTIONS_FILE_UNSET+=NTVFS
OPTIONS_FILE_UNSET+=PROFILE
OPTIONS_FILE_UNSET+=QUOTAS
OPTIONS_FILE_UNSET+=SPOTLIGHT
OPTIONS_FILE_SET+=SYSLOG
OPTIONS_FILE_SET+=UTMP
OPTIONS_FILE_SET+=GSSAPI_BUILTIN
OPTIONS_FILE_UNSET+=GSSAPI_MIT
OPTIONS_FILE_UNSET+=NSUPDATE
OPTIONS_FILE_UNSET+=BIND911
OPTIONS_FILE_UNSET+=BIND913
OPTIONS_FILE_UNSET+=BIND914
OPTIONS_FILE_UNSET+=MDNSRESPONDER
OPTIONS_FILE_SET+=AVAHI
Comment 1 Felix J. Ogris 2019-11-24 16:22:23 UTC
Issue does not exist anymore with Samba 4.10.10 on 12.1-RELEASE
Comment 2 Adonis 2020-04-10 16:46:58 UTC
I am getting this same issue on FreeBSD 12.1, Samba 4.10.13.
Comment 3 Felix J. Ogris 2020-04-12 19:36:23 UTC
Created attachment 213342 [details]
vfs_fruit does not check if there are no bands and divides by zero if the directory is empty

Trivial patch for samba 4.11.7 attached.
Reported also to upstream. See https://bugzilla.samba.org/show_bug.cgi?id=14223