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 2049134 - fix /badfuncs warning in rhel-9 gating about inet_aton
Summary: fix /badfuncs warning in rhel-9 gating about inet_aton
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: NetworkManager
Version: 9.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Thomas Haller
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-02-01 15:31 UTC by Thomas Haller
Modified: 2023-05-18 08:21 UTC (History)
8 users (show)

Fixed In Version: NetworkManager-1.43.8-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-18 08:21:32 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker NMT-79 0 None None None 2023-01-22 14:12:39 UTC
Red Hat Issue Tracker RHELPLAN-110549 0 None None None 2022-02-01 15:37:47 UTC
freedesktop.org Gitlab NetworkManager NetworkManager merge_requests 1620 0 None opened [th/no-inet-aton] avoid using inet_aton() 2023-05-05 18:20:09 UTC

Description Thomas Haller 2022-02-01 15:31:15 UTC
Gating, complains about usage of two deprecated C functions (inet_makeaddr, inet_netof).

See:

 https://dashboard.osci.redhat.com/?filters=eyJ0eXBlIjoiYnJldy1idWlsZCIsImFjdGl2ZSI6WyJOZXR3b3JrTWFuYWdlciJdLCJvcHRpb25zIjp7InNraXBTY3JhdGNoIjpmYWxzZX19#/search

   osci.brew-build.rpminspect.static-analysis about /badfuncs:



>>>>


1) /usr/sbin/NetworkManager may use forbidden functions on aarch64

Result: VERIFY
Waiver Authorization: Anyone

Details:
Forbidden function symbols found:
	inet_makeaddr
	inet_netof


Suggested Remedy:
Forbidden symbols were found in an ELF file in the package.  The configuration settings for rpminspect indicate the named symbols are forbidden in packages.  If this is deliberate, you may want to disable the badfuncs inspection.  If it is not deliberate, check the man pages for the named symbols to see what API functions have replaced the forbidden symbols.  Usually a function is marked as deprecated but still provided in order to allow for backwards compatibility.  Whenever possible the deprecated functions should not be used.



>>>>



Note that inet_aton we *WANT* to use. So we disabled that warning here:
  https://gitlab.com/redhat/centos-stream/rpms/NetworkManager/-/commit/47c72e1b3699b8dcd52f2df1642076921d47c632
  https://gitlab.com/redhat/centos-stream/rpms/NetworkManager/-/commit/1254c71598d6dae140dff96874121d9062511489

for inet_makeaddr and inet_netof, we don't want to use it. We should instead fix the code to not use it.


the problem is, that the functions are used in our systemd fork, so the change needs to be upstreamed to systemd.

Comment 3 Thomas Haller 2022-04-21 20:21:00 UTC
hm. Regrading the symbols inet_makeaddr() and inet_netof(), this fixed itself.

First, systemd dropped usage of the symbols in [1], which we imported to NetworkManager as [2].
Then the symbols were gone.

[1] https://github.com/systemd/systemd/commit/7b868543072bb9073174a4ae46032fdb6eb24c92
[2] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/commit/7b3466fc4cfedd85992fa24953a08f9f07d6d28f

Shortly after, we dropped systemd's n-dhcp4 client altogether (bug 2073067), where these source files were gone.

---

However, we still use (intentionally) inet_aton().

Oddly enough, I just see a warning about that usage ([1]), despite ignoring the symbol in rpminspect.yaml.

I leave the rhbz open to investigate that...

Comment 4 Thomas Haller 2022-04-21 20:22:32 UTC
(In reply to Thomas Haller from comment #3)

> Oddly enough, I just see a warning about that usage ([1]), despite ignoring
> the symbol in rpminspect.yaml.

see "osci.brew-build.rpminspect.static-analysis" test at [1]

[1] https://dashboard.osci.redhat.com/#/artifact/brew-build/aid/44755341

Comment 5 Thomas Haller 2022-11-21 10:28:12 UTC
repurpose the bug. The badfuncs is no inet_aton. See also comment 3.

Comment 6 Thomas Haller 2023-05-09 06:47:42 UTC
this should be fixed with https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/commit/7e03f9c1ba417c429628429a98ea53e3becaa242 by not (directly) using inet_aton() anymore.

Previously, the gating test also complained about other undesirable ABI. We stopped using that ABI a while ago (comment 3).


Interestingly, we had a rpminspect.yaml file, which was supposed to suppress the warning. Which it did not(?? why?).
Anyway, that rpminspect.yaml override (which wasn't working for some reason) is already dropped from c9s branch:
https://gitlab.com/redhat/centos-stream/rpms/NetworkManager/-/commit/1aa10acfaf38c80dd338fa5d45fae24a423edc86



So this should be fixed. When a new badfuncs warning shows up, please report a new issue.

Comment 7 Beniamino Galvani 2023-05-18 08:21:32 UTC
The warning is not visible in the latest 9.3 build.


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