smbd dumps core whed accessing manualy mounted fs

Description

created and shared "dataset", then created "mnt" directory in the shared "dataset", mounted ext3 partition in the "mnt" directory in shared "dataset".

when this share is accessed, smbd dumps core, restarts and runs until cd is performed in samba client.

/usr/sbin/smbd (Thu Nov 18 15:49:04 2021), /usr/sbin/smbd (Thu Nov 18 15:49:04 2021), /usr/sbin/smbd (Thu Nov 18 15:49:05 2021), /usr/sbin/smbd (Thu Nov 18 15:49:05 2021), /usr/sbin/smbd (Thu Nov 18 15:49:06 2021), /usr/sbin/smbd (Thu Nov 18 15:49:06 2021), /usr/sbin/smbd (Thu Nov 18 15:49:07 2021), /usr/sbin/smbd (Thu Nov 18 15:49:07 2021). Please create a ticket at https://jira.ixsystems.com/ and attach the relevant core files along with a system debug. Once the core files have been archived and attached to the ticket, they may be removed by running the following command in shell: 'rm /var/db/system/cores/*'.

2021-11-18 15:49:12 (Europe/Amsterdam)

Problem/Justification

None

Impact

None

Activity

Show:

Matus November 25, 2021 at 1:13 PM
Edited

the same crash happens when .zfs directory for dataset is accessed through samba

Matus November 22, 2021 at 9:21 PM

I now understand this is not supported feature. I just needed to copy some data from ext3 disk, tried my experimental TrueNAS installation and found it was way too slow. Only later I found out that smbd crashed, so I submitted this ticket. If non zfs fs export is denied at vfs level, this should prevent any other users like me to cause smbd to crash, which is a good thing I think, that was the purpose of this ticket.

thanks for great piece of software guys!

Andrew Walker November 22, 2021 at 8:45 PM

But that said, we will not support exporting ext3/4 over SMB in SCALE.

Andrew Walker November 22, 2021 at 8:44 PM

As I mentioned this is a multi-step fix. First off is to actively discourage users from doing unsupported things. We do not support exporting ext3 filesystems over SMB.
The NULL deref and samba crash is fixed in the github PR against the samba repo for the vfs module that handles zfs integration. I'm somewhat inclined to simply assert in the module if we hit an FS that isn't ZFS because in general behavior will not be well-defined.

Matus November 22, 2021 at 8:35 PM
Edited

not sure if this patch prevents mentioned core dump. the error can be reproduced as follows:

  1. share any VALID zfs dataset, for eample /mnt/pool_data/my_data

  2. mkdir /mnt/pool_data/my_data/mnt

  3. mount -t ext3 /dev/sdb1 /mnt/pool_data/my_data/mnt

  4. access \\nas\my_data\mnt using windows explorer. core dumped.

Complete
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Impact

Low

Time remaining

0m

Components

Fix versions

Affects versions

Priority

Katalon Platform

Created November 18, 2021 at 4:55 PM
Updated July 6, 2022 at 8:57 PM
Resolved November 22, 2021 at 8:49 PM