Bug 1213328

Summary: Mount option user does not work anymore
Product: [openSUSE] openSUSE Tumbleweed Reporter: Dr. Werner Fink <werner>
Component: BasesystemAssignee: Neil Brown <nfbrown>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: petr.vorel
Version: Current   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE Tumbleweed   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: sudo dmesg -T

Description Dr. Werner Fink 2023-07-14 11:22:08 UTC
I've a mount entry to mount my working partition from on workstation (the NFS server) on an other workstation (the NFS client) ... this mount entry uses the option `user`:

/suse/werner> grep /werner /etc/fstab 
#boole.suse.de:/usr/src/werner    /usr/src/werner nfs noauto,user,exec,rsize=32768,wsize=32768,namlen=255,retrans=6,sec=sys,tcp 0 0
10.168.4.5:/usr/src/werner    /usr/src/werner nfs noauto,user,exec,rsize=32768,wsize=32768,namlen=255,retrans=6,sec=sys,tcp 0 0

but I see

/suse/werner> mount /usr/src/werner
mount.nfs: failed to prepare mount: Operation not permitted

... the suid bit is set

/suse/werner> ll /sbin/mount.nfs*
-rwsr-xr-x 1 root root 96752 Jun 16 17:21 /sbin/mount.nfs
lrwxrwxrwx 1 root root     9 Jun 16 17:20 /sbin/mount.nfs4 -> mount.nfs
Comment 1 Petr Vorel 2023-07-14 12:10:11 UTC
Could you please specify kernel version you're using and post dmesg output (if any)?
Comment 2 Petr Vorel 2023-07-14 12:11:31 UTC
Also mount.nfs -V.
Comment 3 Dr. Werner Fink 2023-07-14 12:35:25 UTC
Created attachment 868214 [details]
sudo dmesg -T

(In reply to Petr Vorel from comment #2)
> Also mount.nfs -V.

/suse/werner> uname -a
Linux noether 6.4.2-1-default #1 SMP PREEMPT_DYNAMIC Mon Jul 10 10:03:25 UTC 2023 (b97b894) x86_64 x86_64 x86_64 GNU/Linux

/suse/werner> mount.nfs -V /usr/src/werner
mount.nfs: (linux nfs-utils 2.6.3)

/suse/werner> sudo dmesg -T | grep -iE 'nfs'
[Fri Jul 14 13:09:49 2023] RPC: Registered tcp NFSv4.1 backchannel transport module.
[Fri Jul 14 13:09:49 2023] NFS: Registering the id_resolver key type
Comment 4 Dr. Werner Fink 2023-07-21 09:37:15 UTC
I've changed the order of the option for the NFS share and no it works

Before

10.168.4.5:/usr/src/werner    /usr/src/werner nfs noauto,user,exec,rsize=32768,wsize=32768,namlen=255,retrans=6,sec=sys,tcp 0 0

Now

10.168.4.5:/usr/src/werner    /usr/src/werner nfs exec,noauto,user,rsize=32768,wsize=32768,namlen=255,retrans=6,sec=sys,tcp 0 0

IMHO the option parser of mount and/or mount.nfs[4] is broken
Comment 5 Petr Vorel 2023-07-21 12:22:21 UTC
(In reply to Dr. Werner Fink from comment #4)
...
> IMHO the option parser of mount and/or mount.nfs[4] is broken

If there is a regression, it should be easy to fix it once identified problematic commit.

As you have the working setup, would you mind to 1) check if the problem is on upstream master [1], 2) if yes, could you please try to bisect to find which change introduced it? 3) I'd be surprised if you were not able to trigger the problem on upstream, since we have single patch nfs-utils-1.0.7-bind-syntax.patch [2], which is innocent.

[1] git://git.linux-nfs.org/projects/steved/nfs-utils.git
[2] https://build.opensuse.org/package/view_file/Base:System/nfs-utils/nfs-utils-1.0.7-bind-syntax.patch?expand=1
Comment 6 Petr Vorel 2023-07-21 12:26:39 UTC
I also don't see any commit on current master (after 2.6.3) which would fix parsing.
Comment 7 Neil Brown 2023-07-24 23:48:29 UTC
Parsing of option mostly happen in libmount, part of util-linux.
There have been some changed relating to parsing user and user= recently.

I'll see if I can reproduce this locally
Comment 8 Neil Brown 2023-07-25 01:33:57 UTC
util-linux is definitely broken.

https://github.com/util-linux/util-linux/issues/2392

I don't know how to fix it.
It erroneously determines that "exec" and "user" at the same option, and so it deletes the second one that it sees.

Hopefully we'll get a reply to the github issue I opened.
Comment 9 Neil Brown 2023-07-26 01:27:30 UTC
The bug is fixed in util-linux 2.39.1
I've submitted an update.
Comment 10 Dr. Werner Fink 2023-07-26 06:04:45 UTC
(In reply to Neil Brown from comment #9)
> The bug is fixed in util-linux 2.39.1
> I've submitted an update.

Thanks a lot!
Comment 11 Dr. Werner Fink 2023-07-26 06:05:24 UTC
With this fix it is fixed