Bug 1953847 - [ethtool] The `NLM_F_MULTI` should be used for `NLM_F_DUMP`
Summary: [ethtool] The `NLM_F_MULTI` should be used for `NLM_F_DUMP`
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: kernel
Version: 8.4
Hardware: x86_64
OS: Linux
low
low
Target Milestone: beta
: 8.5
Assignee: Antoine Tenart
QA Contact: Tianhao
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-04-27 05:53 UTC by Gris Ge
Modified: 2021-11-10 04:46 UTC (History)
9 users (show)

Fixed In Version: kernel-4.18.0-313.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-09 19:14:27 UTC
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)
Reproduce C code (2.40 KB, text/x-csrc)
2021-04-27 05:53 UTC, Gris Ge
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Gitlab redhat/rhel/src/kernel rhel-8 merge_requests 534 0 None None None 2021-05-10 14:16:22 UTC
Red Hat Product Errata RHSA-2021:4356 0 None None None 2021-11-09 19:14:58 UTC

Description Gris Ge 2021-04-27 05:53:16 UTC
Created attachment 1775845 [details]
Reproduce C code

Description of problem:

When using `NLM_F_DUMP` to dump ethtool information for all interfaces, the replied netlink message is not using `NLM_F_MULTI` flag.

Version-Release number of selected component (if applicable):
kernel-4.18.0-304.el8.x86_64

How reproducible:
100%

Steps to Reproduce:
1. sudo dnf install -y gcc libnl3-devel
2. gcc -o test -I/usr/include/libnl3 test.c  -L/usr/lib64 -lnl-3 -lnl-genl-3
3. ./test

Actual results:

The nl_message reply of ethtool features dump is not using NLM_F_MULTI

Expected results:

The nl_message reply of ethtool features dump is using NLM_F_MULTI

Additional info:

The test C code is showing route rule dumping is using NLM_F_MULTI

Comment 1 Antoine Tenart 2021-05-05 09:04:42 UTC
A fix was sent upstream by Fernando,

https://lore.kernel.org/netdev/20210504224714.7632-1-ffmancera@riseup.net/T/#u

Comment 2 Antoine Tenart 2021-05-10 14:21:24 UTC
Opened a MR,

https://gitlab.com/redhat/rhel/src/kernel/rhel-8/-/merge_requests/534

Comment 6 Tianhao 2021-06-03 15:12:08 UTC
Are the following outputs expected?

before fix:
[root@dell-per7515-01 ~]# ./test 
Dumping route rule
Got nl message with flags: 2(MULTI)
Got nl message with flags: 2(MULTI)
Dumping ethtool pause
Got family ID of ethtool 20
Got nl message with flags: 0()
Got nl message with flags: 0()
Got nl message with flags: 0()
Got nl message with flags: 0()
Got nl message with flags: 0()


after fix:
[root@dell-per7515-01 ~]# ./test 
Dumping route rule
Got nl message with flags: 2(MULTI)
Got nl message with flags: 2(MULTI)
Dumping ethtool pause
Got family ID of ethtool 20
Got nl message with flags: 2(MULTI)
Got nl message with flags: 2(MULTI)
Got nl message with flags: 2(MULTI)
Got nl message with flags: 2(MULTI)
Got nl message with flags: 2(MULTI)
Got nl message with flags: 2(MULTI)
Got nl message with flags: 2(MULTI)
Got nl message with flags: 2(MULTI)
Got nl message with flags: 2(MULTI)
Got nl message with flags: 2(MULTI)
^C

Comment 7 Antoine Tenart 2021-06-03 15:16:34 UTC
(In reply to Tianhao from comment #6)
> Are the following outputs expected?
> 
> before fix:
> [root@dell-per7515-01 ~]# ./test 
> Dumping route rule
> Got nl message with flags: 2(MULTI)
> Got nl message with flags: 2(MULTI)
> Dumping ethtool pause
> Got family ID of ethtool 20
> Got nl message with flags: 0()
> Got nl message with flags: 0()
> Got nl message with flags: 0()
> Got nl message with flags: 0()
> Got nl message with flags: 0()
> 
> 
> after fix:
> [root@dell-per7515-01 ~]# ./test 
> Dumping route rule
> Got nl message with flags: 2(MULTI)
> Got nl message with flags: 2(MULTI)
> Dumping ethtool pause
> Got family ID of ethtool 20
> Got nl message with flags: 2(MULTI)
> Got nl message with flags: 2(MULTI)
> Got nl message with flags: 2(MULTI)
> Got nl message with flags: 2(MULTI)
> Got nl message with flags: 2(MULTI)
> Got nl message with flags: 2(MULTI)
> Got nl message with flags: 2(MULTI)
> Got nl message with flags: 2(MULTI)
> Got nl message with flags: 2(MULTI)
> Got nl message with flags: 2(MULTI)
> ^C

Yes, this shows the fix worked as expected. Thanks!

Comment 8 Tianhao 2021-06-04 01:43:57 UTC
Ethtool basic tests passed on the kernel-4.18.0-305.3.el8.mr534_210510_1425.

Based on comment #6 and comment #7, set TESTED.

Comment 12 Tianhao 2021-06-21 05:56:59 UTC
Done code check.
The ethtool tests are done in pre-testing.
Set verified based on the results.

Comment 14 errata-xmlrpc 2021-11-09 19:14:27 UTC
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-2021:4356


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