Description of problem: A patch between 8.5 and 8.6 kernels broke some nfs mount options, such as 'noresvport' Version-Release number of selected component (if applicable): kernel-4.18.0-372* (all kernels beginning with kernel-4.18.0-356.el8~13^2~30) How reproducible: easy, see steps below Steps to Reproduce: # mount server:/export /mnt -onoresvport # netstat -anpt | grep -w 2049 Actual results: source TCP port is still in the 'reserved' port range Expected results: source TCP port is 1024+ Additional info: this became broken with the following commit in the RHEL 8.6 kernel: cf2c7c1aa904 NFSv4: Initialise connection to the server in nfs4_alloc_client() this is fixed with this upstream commit: commit 468d126dab45718feeb728319be20bd869a5eaa7 Author: Trond Myklebust <trond.myklebust> Date: 2022-02-02 18:52:01 -0500 NFS: Fix initialisation of nfs_client cl_flags field For some long forgotten reason, the nfs_client cl_flags field is initialised in nfs_get_client() instead of being initialised at allocation time. This quirk was harmless until we moved the call to nfs_create_rpc_client(). Fixes: dd99e9f98fbf ("NFSv4: Initialise connection to the server in nfs4_alloc_client()") Cc: stable.org # 4.8.x Signed-off-by: Trond Myklebust <trond.myklebust> Signed-off-by: Anna Schumaker <Anna.Schumaker>
Verified in kernel 4.18.0-418.el8 https://beaker.engineering.redhat.com/jobs/6915912 # with default "resvport" [22:04:54 root@ ~~]# mount localhost:/exportdir/home /mnt/nfs-mount-options-all -o vers=4.2,resvport [22:04:54 root@ ~~]# grep /mnt/nfs-mount-options-all /proc/mounts localhost:/exportdir/home /mnt/nfs-mount-options-all nfs4 rw,relatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp6,timeo=600,retrans=2,sec=sys,clientaddr=::1,local_lock=none,addr=::1 0 0 [22:04:54 root@ ~~]# ss -n state established dport :nfs Netid Recv-Q Send-Q Local Address:Port Peer Address:PortProcess tcp 0 0 [::1]:821 [::1]:2049 ^^^^^^^^^^ [22:04:54 root@ ~~]# umount /mnt/nfs-mount-options-all # with "noresvport" [22:04:54 root@ ~~]# mount localhost:/exportdir/home /mnt/nfs-mount-options-all -o vers=4.2,noresvport [22:04:54 root@ ~~]# grep /mnt/nfs-mount-options-all /proc/mounts | grep 'noresvport' localhost:/exportdir/home /mnt/nfs-mount-options-all nfs4 rw,relatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,noresvport,proto=tcp6,timeo=600,retrans=2,sec=sys,clientaddr=::1,local_lock=none,addr=::1 0 0 [22:04:55 root@ ~~]# ss -n state established dport :nfs Netid Recv-Q Send-Q Local Address:Port Peer Address:PortProcess tcp 0 0 [::1]:41520 [::1]:2049 ^^^^^^^^^^^^ [22:04:55 root@ ~~]# umount /mnt/nfs-mount-options-all
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: kernel security, bug fix, and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2022:7683