[Bug 2025302] Re: mount.nfs: sloppy options processing is broken on 5.15 HWE kernel
Timo Aaltonen
2025302 at bugs.launchpad.net
Fri Aug 18 06:45:57 UTC 2023
Hello Matthew, or anyone else affected,
Accepted nfs-utils into focal-proposed. The package will build now and
be available at https://launchpad.net/ubuntu/+source/nfs-
utils/1:1.3.4-2.5ubuntu3.5 in a few hours, and then in the -proposed
repository.
Please help us by testing this new package. See
https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how
to enable and use -proposed. Your feedback will aid us getting this
update out to other Ubuntu users.
If this package fixes the bug for you, please add a comment to this bug,
mentioning the version of the package you tested, what testing has been
performed on the package and change the tag from verification-needed-
focal to verification-done-focal. If it does not fix the bug for you,
please add a comment stating that, and change the tag to verification-
failed-focal. In either case, without details of your testing we will
not be able to proceed.
Further information regarding the verification process can be found at
https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in
advance for helping!
N.B. The updated package will be released to -updates after the bug(s)
fixed by this package have been verified and the package has been in
-proposed for a minimum of 7 days.
** Changed in: nfs-utils (Ubuntu Focal)
Status: In Progress => Fix Committed
** Tags added: verification-needed verification-needed-focal
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to nfs-utils in Ubuntu.
https://bugs.launchpad.net/bugs/2025302
Title:
mount.nfs: sloppy options processing is broken on 5.15 HWE kernel
Status in nfs-utils package in Ubuntu:
Fix Released
Status in nfs-utils source package in Focal:
Fix Committed
Bug description:
[Impact]
There was a new mount API introduced to the nfs subsystem in the 5.6
kernel release, that changed how parameters should be passed from
userspace mount.nfs to the kernel.
This broke processing of the sloppy '-s' and '-o' options, where if
you have an invalid mount option, or the ordering of mount options was
incorrect, the mount would fail instead of going through.
The fix is to move the sloppy options to the front of the options
list, and then passing the rest of the options to the kernel, so the
sloppy operator can be parsed correctly.
[Testcase]
Start two Focal VMs, one for the server, and one for the client.
On the Server:
1) sudo apt update
2) sudo apt install nfs-kernel-server
3) sudo mkdir -p /mnt/nfs_share
4) sudo chown -R nobody:nogroup /mnt/nfs_share/
5) sudo chmod 777 /mnt/nfs_share/
6) echo "/mnt/nfs_share 192.168.122.0/24(rw,sync,no_subtree_check)" | sudo tee /etc/exports
7) sudo exportfs -a
8) sudo systemctl restart nfs-kernel-server
9) echo "Testfile" | tee /mnt/nfs_share/testfile
On the client:
1) sudo apt update
2) sudo apt install nfs-common
3) sudo mkdir -p /mnt/nfs_clientshare
4) sudo mount -t nfs 192.168.122.114:/mnt/nfs_share /mnt/nfs_clientshare -s -o invalid,intr
On the client with 5.4 kernel:
$ uname -rv
5.4.0-152-generic #169-Ubuntu SMP Tue Jun 6 22:23:09 UTC 2023
$ sudo mount -t nfs 192.168.122.114:/mnt/nfs_share /mnt/nfs_clientshare -s -o invalid,intr
$ cd /mnt/nfs_clientshare/
/mnt/nfs_clientshare$ ll
total 12
drwxrwxrwx 2 nobody nogroup 4096 Jun 29 01:13 ./
drwxr-xr-x 3 root root 4096 Jun 29 01:11 ../
-rw-rw-r-- 1 ubuntu ubuntu 9 Jun 29 01:13 testfile
/mnt/nfs_clientshare$ cat testfile
Testfile
On the client with the 5.15 HWE kernel:
$ uname -rv
5.15.0-76-generic #83~20.04.1-Ubuntu SMP Wed Jun 21 20:23:31 UTC 2023
$ sudo mount -t nfs 192.168.122.114:/mnt/nfs_share /mnt/nfs_clientshare -s -o invalid,intr
mount.nfs: an incorrect mount option was specified
There are test packages in the following ppa:
https://launchpad.net/~mruffell/+archive/ubuntu/sf352441-test
If you install them, when using the HWE kernel, you will see:
$ uname -rv
5.15.0-76-generic #83~20.04.1-Ubuntu SMP Wed Jun 21 20:23:31 UTC 2023
$ sudo mount -t nfs 192.168.122.114:/mnt/nfs_share /mnt/nfs_clientshare -s -o invalid,intr
$ cd /mnt/nfs_clientshare/
/mnt/nfs_clientshare$ ll
total 12
drwxrwxrwx 2 nobody nogroup 4096 Jun 29 01:13 ./
drwxr-xr-x 3 root root 4096 Jun 29 01:11 ../
-rw-rw-r-- 1 ubuntu ubuntu 9 Jun 29 01:13 testfile
/mnt/nfs_clientshare$ cat testfile
Testfile
[Where problems could occur]
We are changing how options parameters are parsed. If a regression
were to occur, user's nfs mount commands might fail, which has the
possibility of breaking nfs-clients. If a system is set to mount a
share on boot, a share might not be available without manual
intervention.
Users should not have to modify their mount commands at all. But if a
regression were to occur, sysadmins may need to change to the ordering
of their options.
This does not change nfs-servers, only nfs-clients.
[Other Info]
This issue was fixed in 2.6.1 of nfs-utils with the following commits:
commit 92b664ef4f25f1bd920bea4db435345629543353
From: Jianhong Yin <yin-jianhong at 163.com>
Date: Thu, 10 Jun 2021 13:27:29 -0400
Subject: mount.nfs: insert 'sloppy' at beginning of the options
Link: https://git.linux-nfs.org/?p=steved/nfs-utils.git;a=patch;h=92b664ef4f25f1bd920bea4db435345629543353
commit 4dd8d833c9350d42528ada0fd65aee41b712f41d
From: Steve Dickson <steved at redhat.com>
Date: Tue, 20 Jul 2021 17:14:04 -0400
Subject: mount.nfs: Fix the sloppy option processing
Link: https://git.linux-nfs.org/?p=steved/nfs-utils.git;a=patch;h=4dd8d833c9350d42528ada0fd65aee41b712f41d
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/nfs-utils/+bug/2025302/+subscriptions
More information about the foundations-bugs
mailing list