Samba aborts when deleting a file and "vfs_streams_xattr" is used.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
samba |
Unknown
|
Unknown
|
|||
samba (Ubuntu) |
Fix Released
|
Medium
|
Sergio Durigan Junior | ||
Jammy |
Fix Released
|
Medium
|
Sergio Durigan Junior |
Bug Description
[ Impact ]
Samba users who create shares that use vfs_fruit and the option "fruit:resource = stream" will face a crash with SIGABRT when trying to delete a file.
[ Test Plan ]
Thanks to Mike Silva for coming up with a simple reproducer for this bug.
$ lxc launch ubuntu-daily:jammy samba-bug1977491
$ lxc shell samba-bug1977491
# apt update
# apt install -y samba smbclient
# mkdir /testshare
# chown ubuntu:ubuntu /testshare
# $EDITOR /etc/samba/smb.conf
Add the following snippet inside the "[global]" section of the smb.conf file:
fruit:resource = stream
vfs objects = fruit streams_xattr
# cat >> /etc/samba/smb.conf << _EOF_
[testshare]
path = /testshare
browseable = yes
read only = no
guest ok = yes
writable = yes
_EOF_
# systemctl restart smbd.service
# smbpasswd -a ubuntu
(Choose an easy password here)
# cat > testfile << _EOF_
this is a test file
_EOF_
# smbclient '\\127.
...
smb: \> put testfile
smb: \> rm testfile
You should see an error like this:
NT_STATUS_
NT_STATUS_
smb: \> SMBecho failed (NT_STATUS_
And if you inspect the file /var/log/
[2022/06/17 23:30:01.597926, 0] ../../lib/
PANIC (pid 2649): assert failed: smb_fname->fsp != NULL in 4.15.5-Ubuntu
[2022/06/17 23:30:01.603078, 0] ../../lib/
BACKTRACE: 29 stack frames:
#0 /lib/x86_
#1 /lib/x86_
#2 /usr/lib/
#3 /usr/lib/
#4 /usr/lib/
#5 /usr/lib/
... backtrace truncated ...
N.B.: You might also want to test with "fruit:time machine = yes" for completeness.
[ Where problems could occur ]
The patch that fixes the issue has been recently proposed upstream, and as such it hasn't been extensively tested by the Samba community in general. Both the reporter, the Samba developers and I tried to make sure that different scenarios are working correctly with the patch applied, but there is a small risk that some corner hasn't been covered.
Even if that is indeed the case, it is hard to talk about "regressions" here when the previous behaviour was a SIGABRT crash. The Samba developers were very responsive regarding this issue, so I'm sure that, if a problem happens, we can work together to come up with a solution fairly quickly.
[ Original Description ]
In Ubuntu 22.04 LTS, there is currently a regression in Samba 4.15.5 and a new issue, both of which cause connection issues with macOS clients. The regression causes segfaults with macOS client connections. The new issue, breaks durable handles, which are crucial to Samba's support of Time Machine over SMB (using vfs_fruit).
For the regression:
https:/
For the new issue:
https:/
This regression was fixed in Samba 4.15.6, see:
https:/
The new issue in 4.15.7, see:
https:/
Related branches
- git-ubuntu bot: Approve
- Sergio Durigan Junior (community): Approve
- Canonical Server Reporter: Pending requested
-
Diff: 3439 lines (+2767/-97)18 files modifieddebian/changelog (+2313/-0)
debian/control (+6/-5)
debian/ctdb.example/nfs-kernel-server/enable-nfs.sh (+26/-36)
debian/ctdb.example/nfs-kernel-server/nfs.conf (+20/-0)
debian/ctdb.example/nfs-kernel-server/quota (+5/-0)
debian/patches/VERSION.patch (+2/-2)
debian/patches/add-support-for-bind-918-2.patch (+51/-0)
debian/patches/add-support-for-bind-918.patch (+54/-0)
debian/patches/fix-nfs-service-name-to-nfs-kernel-server.patch (+37/-28)
debian/patches/lp1977491-dont-crash-on-vfs_fruit-resource-stream-01.patch (+121/-0)
debian/patches/lp1977491-dont-crash-on-vfs_fruit-resource-stream-02.patch (+96/-0)
debian/patches/series (+4/-0)
debian/rules (+4/-0)
debian/smb.conf (+15/-9)
debian/tests/cifs-share-access-uring (+6/-0)
debian/tests/smbclient-share-access-uring (+6/-0)
debian/tests/util (+1/-1)
dev/null (+0/-16)
- git-ubuntu bot: Approve
- Andreas Hasenack (community): Approve
- Canonical Server Reporter: Pending requested
- Canonical Server Reporter: Pending requested
- Canonical Server Reporter: Pending requested
- Canonical Server: Pending requested
-
Diff: 256 lines (+228/-0)4 files modifieddebian/changelog (+12/-0)
debian/patches/lp1977491-dont-crash-on-vfs_fruit-resource-stream-01.patch (+121/-0)
debian/patches/lp1977491-dont-crash-on-vfs_fruit-resource-stream-02.patch (+93/-0)
debian/patches/series (+2/-0)
- git-ubuntu bot: Approve
- Andreas Hasenack (community): Approve
- Canonical Server: Pending requested
-
Diff: 259 lines (+231/-0)4 files modifieddebian/changelog (+12/-0)
debian/patches/lp1977491-dont-crash-on-vfs_fruit-resource-stream-01.patch (+121/-0)
debian/patches/lp1977491-dont-crash-on-vfs_fruit-resource-stream-02.patch (+96/-0)
debian/patches/series (+2/-0)
summary: |
- Update Samba in 22.04LTS to 4.15.7 + Update Samba in 22.04LTS to 4.15.7 so macOS clients can connect and + transfer. |
Changed in samba (Ubuntu): | |
status: | Invalid → Confirmed |
Changed in samba (Ubuntu): | |
assignee: | nobody → Sergio Durigan Junior (sergiodj) |
Changed in samba (Ubuntu Jammy): | |
assignee: | nobody → Sergio Durigan Junior (sergiodj) |
tags: | added: server-todo |
Changed in samba (Ubuntu): | |
status: | Confirmed → Triaged |
importance: | Undecided → Medium |
Changed in samba (Ubuntu Jammy): | |
status: | Confirmed → Triaged |
importance: | Undecided → Medium |
description: | updated |
summary: |
- Update Samba in 22.04LTS to 4.15.7 so macOS clients can connect and - transfer. + Samba aborts when deleting a file and "fruit:resource = stream" is used |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
Changed in samba (Ubuntu Jammy): | |
status: | Triaged → In Progress |
Changed in samba (Ubuntu): | |
status: | Triaged → In Progress |
Status changed to 'Confirmed' because the bug affects multiple users.