Bug 2098463

Summary: lshw makes DNS queries
Product: Red Hat Enterprise Linux 9 Reporter: Stewart Smith <trawets>
Component: lshwAssignee: ltao
Status: CLOSED ERRATA QA Contact: Jeff Bastian <jbastian>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: CentOS StreamCC: bstinson, jbastian, jwboyer, ruyang, rvr
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lshw-B.02.19.2-9.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-15 11:22:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Stewart Smith 2022-06-19 17:21:53 UTC
Description of problem:
lshw will make an external DNS query on `lshw -version` to check what the latest upstream version is.

Version-Release number of selected component (if applicable):
lshw-B.02.19.2-7

How reproducible:
100%

Steps to Reproduce:
1. `ltrace -l libresolv.so* lshw -version` will show the lookup.

Actual results:
A call to `__res_querydomain`.

Expected results:
No DNS query!

Additional info:
Fedora PR https://src.fedoraproject.org/rpms/lshw/pull-request/1
(C9s one coming after filing this bug)

Comment 1 Stewart Smith 2022-06-19 17:23:07 UTC
Centos Stream merge request: https://gitlab.com/redhat/centos-stream/rpms/lshw/-/merge_requests/3

Comment 2 Stewart Smith 2022-06-19 20:06:26 UTC
Upstream PR: https://github.com/lyonel/lshw/pull/86

Comment 3 ltao 2022-07-18 01:22:52 UTC
Hi Jeff,

Could you please set qa_ack flags for this bz?

Thanks,
Tao Liu

Comment 4 Jeff Bastian 2022-07-18 20:59:29 UTC
qa_ack+ and ITM are set

Comment 5 Jeff Bastian 2022-07-21 22:35:09 UTC
The suggested ltrace reproducer in comment 0 does not work for me:

[root@localhost ~]# ltrace -l libresolv.so* lshw -version
B.02.19.2
the latest version is B.02.18
+++ exited (status 0) +++

In fact, lshw is not even linked to libresolv.so:

[root@ampere-mtsnow-altramax-02 ~]# ldd /usr/sbin/lshw
	linux-vdso.so.1 (0x0000ffff9d1c0000)
	libstdc++.so.6 => /lib64/libstdc++.so.6 (0x0000ffff9ce89000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000ffff9ce58000)
	libc.so.6 => /lib64/libc.so.6 (0x0000ffff9ccaa000)
	/lib/ld-linux-aarch64.so.1 (0x0000ffff9d183000)
	libm.so.6 => /lib64/libm.so.6 (0x0000ffff9cc09000)



However, I was able to view the DNS lookup with Wireshark in another terminal:

### terminal 1
[root@localhost ~]# tshark port 53
Running as user "root" and group "root". This could be dangerous.
Capturing on 'eno1'


### terminal 2

[root@localhost ~]# rpm -q lshw
lshw-B.02.19.2-7.el9.aarch64

[root@localhost ~]# lshw -version
B.02.19.2
the latest version is B.02.18


### meanwhile, back in terminal 1

    1 0.000000000   10.8.1.199 → 10.11.5.19   DNS 73 Standard query 0x39a4 TXT lshw.ezix.org
    2 0.000691844   10.11.5.19 → 10.8.1.199   DNS 93 Standard query response 0x39a4 TXT lshw.ezix.org TXT


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Repeating the test with the updated lshw version:

### terminal 1
[root@localhost ~]# tshark port 53
Running as user "root" and group "root". This could be dangerous.
Capturing on 'eno1'


### terminal 2

[root@localhost ~]# rpm -q lshw
lshw-B.02.19.2-9.el9.aarch64

[root@localhost ~]# lshw -version
B.02.19.2


### meanwhile, back in terminal 1

# (no output from tshark) - success!

Comment 10 errata-xmlrpc 2022-11-15 11:22:17 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 (lshw 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/RHBA-2022:8382