RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1764075 - [s390x] nsm_use_hostnames=1 shows 16777216 by `sysctl` in big-endian architectures
Summary: [s390x] nsm_use_hostnames=1 shows 16777216 by `sysctl` in big-endian architec...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: kernel
Version: 8.0
Hardware: s390x
OS: Linux
low
low
Target Milestone: rc
: 8.6
Assignee: Alice Mitchell
QA Contact: Yongcheng Yang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-10-22 08:25 UTC by Yongcheng Yang
Modified: 2022-05-03 07:27 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1355652
Environment:
Last Closed: 2022-05-03 07:27:24 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Yongcheng Yang 2019-10-22 08:25:48 UTC
[root]# tail -1 /etc/modprobe.d/lockd.conf
options lockd nsm_use_hostnames=1
[root]# modprobe lockd
[root]# cat /sys/module/lockd/parameters/nsm_use_hostnames
Y
[root]# cat /proc/sys/fs/nfs/nsm_use_hostnames
16777216
[root@ibm-z-121 kernel]# ls -l /proc/sys/fs/nfs/nsm_use_hostnames /sys/module/lockd/parameters/nsm_use_hostnames
-rw-r--r--. 1 root root    0 Oct 22 04:12 /proc/sys/fs/nfs/nsm_use_hostnames
-rw-r--r--. 1 root root 4096 Oct 22 04:12 /sys/module/lockd/parameters/nsm_use_hostnames
[root@ibm-z-121 kernel]# uname --machine
s390x


+++ This bug was initially created as a clone of Bug #1355652 +++

Steps to Reproduce:
1. echo 'options lockd nsm_use_hostnames=1' >/etc/modprobe.d/lockd.conf
2. Re-load the module lockd or reboot system to make it effective
3. sysctl fs.nfs.nsm_use_hostnames
4. cat /sys/module/lockd/parameters/nsm_use_hostnames

Actual results:
# After enabled it
[root]# sysctl fs.nfs.nsm_use_hostnames
fs.nfs.nsm_use_hostnames = 16777216 <<<<<<<<<<<<<<<<< 
[root@]# cat /sys/module/lockd/parameters/nsm_use_hostnames 
Y
[root]# 

Expected results:
[root]# sysctl fs.nfs.nsm_use_hostnames
fs.nfs.nsm_use_hostnames = 1  <<<<<<<<<<<<<<<<<<<<<<<<<<
[root@]# cat /sys/module/lockd/parameters/nsm_use_hostnames 
Y
[root]#

Additional info:
[yoyang@yoyang-pc lockd]$ awk 'BEGIN{print log(16777216)/log(2)}'
24
[yoyang@yoyang-pc lockd]$ awk 'BEGIN{print 2**24}'
16777216
[yoyang@yoyang-pc lockd]$

Comment 1 Yongcheng Yang 2019-10-22 08:59:01 UTC
As the parameter "Y" is correct (in file "/sys/module/lockd/parameters/nsm_use_hostnames") and only the `sysctl` get the messy value. Let's see if this is the sysctl tool's issue.

(In reply to Yongcheng Yang from comment #0)
...
> [root]# sysctl fs.nfs.nsm_use_hostnames
> fs.nfs.nsm_use_hostnames = 16777216 <<<<<<<<<<<<<<<<< 
> [root@]# cat /sys/module/lockd/parameters/nsm_use_hostnames 
> Y
> [root]# 

Some more tests shows `sysctl -w fs.nfs.nsm_use_hostnames=1` won't work as expected:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# sysctl -w fs.nfs.nsm_use_hostnames=0
fs.nfs.nsm_use_hostnames = 0
# cat /sys/module/lockd/parameters/nsm_use_hostnames 
N
 
# sysctl -w fs.nfs.nsm_use_hostnames=1
fs.nfs.nsm_use_hostnames = 1            <<<<
# cat /sys/module/lockd/parameters/nsm_use_hostnames
N                                       <<<<
 
# sysctl -w fs.nfs.nsm_use_hostnames=16777216
fs.nfs.nsm_use_hostnames = 16777216
# cat /sys/module/lockd/parameters/nsm_use_hostnames
Y

Comment 2 Yongcheng Yang 2019-10-22 09:28:55 UTC
I'm changing this back to kernel NFS again, apologize.

Just find an upstream patch but it has not been accepted yet:
https://patchwork.kernel.org/patch/9475657/

However, it suggests the culprit is in fs/lockd/svc.c
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
582         {
583                 .procname       = "nsm_use_hostnames",
584                 .data           = &nsm_use_hostnames,
585                 .maxlen         = sizeof(int),
586                 .mode           = 0644,
587                 .proc_handler   = proc_dointvec, <<<<
588         },
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Comment 4 Alice Mitchell 2020-03-12 12:35:09 UTC
Not a config file issue as this is a sysctl kernel parameter, but it looks to me that the error is that nsm_use_hostnames is defined as a type bool, which afaics is never done for sysctl parameters, they are all int type. which leads to the buffer overruns as the size field is set to that of an int not a bool.

previous patch would not have been accepted as there is no proc_dobool() and no sysctl parameters are declared bool afaics.

I expect the following patch will fix the issue :-
--- fs/lockd/mon.c.orig	2020-03-12 12:32:16.614585321 +0000
+++ fs/lockd/mon.c	2020-03-12 12:32:19.968611359 +0000
@@ -58,7 +58,7 @@
  * Local NSM state
  */
 u32	__read_mostly		nsm_local_state;
-bool	__read_mostly		nsm_use_hostnames;
+int	__read_mostly		nsm_use_hostnames;
 
 static inline struct sockaddr *nsm_addr(const struct nsm_handle *nsm)
 {

Comment 7 RHEL Program Management 2021-04-22 07:31:27 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

Comment 16 RHEL Program Management 2022-05-03 07:27:24 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.


Note You need to log in before you can comment on or make changes to this bug.