Bug 1396563 - rpmlint often reports false positives missing-call-to-chdir-with-chroot on x86_64
Summary: rpmlint often reports false positives missing-call-to-chdir-with-chroot on x8...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: rpmlint
Version: 26
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tom "spot" Callaway
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1419938
TreeView+ depends on / blocked
 
Reported: 2016-11-18 16:01 UTC by Petr Menšík
Modified: 2018-05-03 09:15 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-05-03 09:15:14 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
suggested fix (1.02 KB, patch)
2016-11-18 16:04 UTC, Petr Menšík
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Github rpm-software-management rpmlint issues 84 0 'None' closed False positives reporting missing-call-to-chdir-with-chroot 2020-03-08 14:02:28 UTC
Red Hat Bugzilla 1422789 0 low CLOSED Missing chdir call after chroot 2021-02-22 00:41:40 UTC

Internal Links: 1422789

Description Petr Menšík 2016-11-18 16:01:37 UTC
Description of problem:
rpmlint reports missing-call-to-chdir-with-chroot on libraries, where there is not really such problem. I found it on bind99-libs that I manage, but it is reported on other libraries. And it is not warning, but error.

Version-Release number of selected component (if applicable):
1.9-3.fc24

How reproducible:
Always

Steps to Reproduce:
1. use X86_64 machine
2. dnf install bind99-libs
3. rpmlint -c BinariesCheck bind99-libs

Actual results:
bind99-libs.x86_64: E: missing-call-to-chdir-with-chroot /usr/lib64/bind99/libisc-export.so.106.1.1
1 packages and 0 specfiles checked; 1 errors, 0 warnings.

Expected results:
$ LANG=C rpmlint -c BinariesCheck bind99-libs
1 packages and 0 specfiles checked; 0 errors, 0 warnings.

Additional info:
I found rpmlint uses 3 conditions.
Binary uses/links:
* chroot
* chdir
* chdir is close to chroot

And the last one is actually not able to validate. Even then it reports error. It looks for chroot@plt and chdir@plt. But if none of them is found, it reports error too. If application links chdir and chroot calls, it is enough to report error.

Comment 1 Petr Menšík 2016-11-18 16:04:52 UTC
Created attachment 1221904 [details]
suggested fix

Comment 2 Petr Menšík 2016-11-18 16:07:43 UTC
@plt tables are not even possible on x86_64. And are not available for every code with PIC flag used. Unfortunately, disassembly with PIC does not contain function names that could be used instead.

Comment 3 Tom "spot" Callaway 2016-11-18 16:15:14 UTC
Logic seems correct to me, but I want to make sure upstream is fine with it. Ville?

Comment 4 Ville Skyttä 2016-11-21 15:30:20 UTC
This area of code has received quite significant changes lately upstream. I suggest checking with current git master whether the issue persists, and if yes, rebasing the suggested fix against master and submitting a github PR for it. I also admit that this stuff is outside my area of competence, so be prepared to point out explanations/docs, provide packages for testing, and have patience.

Comment 5 Petr Menšík 2016-11-21 16:51:24 UTC
Yes, upstream is different, but fails the same way also. I wonder why upstream tests it only for x86_64, when recent Fedora does have only a few binaries containing at least single call matching this spec.

Reported as https://github.com/rpm-software-management/rpmlint/issues/84

Comment 6 Ville Skyttä 2016-11-22 07:47:37 UTC
(In reply to Petr Menšík from comment #5)
> I wonder why upstream tests it only for x86_64

https://github.com/rpm-software-management/rpmlint/pull/80

Comment 7 Petr Menšík 2016-11-22 11:29:07 UTC
Well I think 
https://github.com/rpm-software-management/rpmlint/pull/80 should be reverted. It is looking for call OR callq calls, because there is callq?. It supported checking for both before, as in current Fedora 24. This makes regression only because someone was confused by comment in code.

Comment 8 Jiří Vymazal 2017-02-28 10:24:54 UTC
This issue is happening with rsyslog as well, in 8.24.0-6 I patched in the chdir call but rpmlint error remains.

Comment 9 Fedora End Of Life 2017-02-28 10:38:17 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 10 Fedora End Of Life 2018-05-03 08:19:26 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '26'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 11 Jiří Vymazal 2018-05-03 09:15:14 UTC
This seems to be resolved in rawhide (for both bind99-libs and rsyslog), closing.


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