Bug 28778 - chkrootkit reports error during checking chsh (fixed in 0.55)
Summary: chkrootkit reports error during checking chsh (fixed in 0.55)
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 8
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: QA Team
QA Contact:
URL:
Whiteboard: MGA8-64-OK
Keywords: advisory, validated_update
Depends on:
Blocks:
 
Reported: 2021-04-14 12:51 CEST by Christophe Nanteuil
Modified: 2021-12-19 17:14 CET (History)
6 users (show)

See Also:
Source RPM: chkrootkit-0.54-1.mga8.src.rpm
CVE:
Status comment:


Attachments

Description Christophe Nanteuil 2021-04-14 12:51:34 CEST
Description of problem:
chkrootkit reports a syntax error while performing check for chsh


Steps to Reproduce:

[root@localhost ~]# LC_ALL=C chkrootkit chsh
ROOTDIR is `/'
Checking `chsh'... /usr/sbin/chkrootkit: ligne 1476 : [:  :  integer expression expected
not infected
[root@localhost ~]# 

changing line 1475 by adding a leading '0' (see diff below) suppresses the error but I have not yet verified that is the expected behaviour (test for Fedora distrib).
Any suggestion?

--- /root/tmp/chkrootkit	2021-04-14 12:47:20.555640465 +0200
+++ /root/tmp/chkrootkit2	2021-04-14 12:47:49.735740997 +0200
@@ -1472,7 +1472,7 @@
     REDHAT_PAM_LABEL="*NOT*"
     GENERIC_ROOTKIT_FEDORA=${GENERIC_ROOTKIT_LABEL} 
     if [ -f  /etc/system-release ]; then 
-       v=`${egrep} -i fedora /etc/system-release | cut -d " " -f 3`
+       v="0"`${egrep} -i fedora /etc/system-release | cut -d " " -f 3`
        if [ "$v" -gt "32" ]; then 
           GENERIC_ROOTKIT_FEDORA="bash|elite$|vejeta|\.ark|iroffer"
        fi
Dick Gevers 2021-04-14 13:49:12 CEST

CC: (none) => dvgevers

Comment 1 Lewis Smith 2021-04-14 21:56:28 CEST
Thank you for the report and detailed diagnosis.

This SRPM has no registered maintainer, and is done by different people; so assigning the bug globally.

Assignee: bugsquad => pkg-bugs

Comment 2 David Walser 2021-04-19 04:17:30 CEST
Instead of adding a 0, if you change fedora to mageia, does it work?

CC: (none) => luigiwalser

Comment 3 Christophe Nanteuil 2021-06-09 16:21:44 CEST
Sorry for the delay.

Well, it works but the test checks for Fedora release number to verify if the release is newer than 32 (release date: april 2020).
If the test succeeds (ie fedora release >= 32), it suppresses the pattern '^/bin/.*sh$' in the search of strings in the chsh binary (found in $PATH).

Just change 'fedora' to 'mageia' would make no sense. I do not have any string matching the pattern in my system. I suggest that the test should return 0 to indicate that the system is not a fedora release greater than 32.
Comment 4 David Walser 2021-06-09 16:25:13 CEST
How about changing "fedora" to "mageia" and "32" to "7" ?
Comment 5 Christophe Nanteuil 2021-06-09 16:40:55 CEST
I think the bug was introduced as a regression from the bug fix related to:
https://bugzilla.redhat.com/show_bug.cgi?id=1904328

I emailed the authors of chkrootkit.
Comment 6 Christophe Nanteuil 2021-12-12 23:01:22 CET
chkrootkit version 0.55 fixes this bug (with the patch above).
v0.55 is used in the Cauldron package, but do we backport to this release version (either with the patch above or by using chkrootkit v0.55)?
Comment 7 David Walser 2021-12-13 17:09:54 CET
(In reply to David Walser from comment #4)
> How about changing "fedora" to "mageia" and "32" to "7" ?

Can you answer this question please?

(In reply to Christophe Nanteuil from comment #6)
> chkrootkit version 0.55 fixes this bug (with the patch above).
> v0.55 is used in the Cauldron package, but do we backport to this release
> version (either with the patch above or by using chkrootkit v0.55)?

In other words 0.55 doesn't fix it.  Once we determine how to actually fix it properly, I do think we should update Mageia 8 to the latest.

(In reply to Christophe Nanteuil from comment #5)
> I think the bug was introduced as a regression from the bug fix related to:
> https://bugzilla.redhat.com/show_bug.cgi?id=1904328
> 
> I emailed the authors of chkrootkit.

Did you get a response from them?
Comment 8 Christophe Nanteuil 2021-12-14 07:18:03 CET
Changing "fedora" to "mageia" does not make sense to me as the test is a workaround for a false positive specific to fedora distrib.


The chkrootkit developers included my patch in v0.55 the day after I emailed them. They did not notify me, so I only noticed last week.
Comment 9 David Walser 2021-12-14 17:08:18 CET
The website for chkrootkit is currently down, but the changelog for 0.55 is:
 06/10/2021 - Version 0.55 Umbreon Linux Rootkit detection 
                        Kinsing.A Backdoor 
                        RotaJakito Backdoor 
                        Minor bug fixes 

chkrootkit-0.55-1.mga8

from chkrootkit-0.55-1.mga8.src.rpm

Assignee: pkg-bugs => qa-bugs
Version: Cauldron => 8
Summary: chkrootkit reports error during checking chsh => chkrootkit reports error during checking chsh (fixed in 0.55)

PC LX 2021-12-15 01:38:33 CET

CC: (none) => mageia

Comment 10 Herman Viaene 2021-12-16 15:43:17 CET
MGA8-64 Plasma on Lenovo B50 in Dutch
No installation issues
Used command specified above:
# LC_ALL=C chkrootkit chsh
ROOTDIR is `/'
Checking `chsh'... not infected
No error as discussed above, so I suppose this is good, but plse correct me if necessary.

Whiteboard: (none) => MGA8-64-OK
CC: (none) => herman.viaene

Comment 11 PC LX 2021-12-16 18:30:51 CET
Installed and tested without issues.


System: Mageia 8, x86_64, Intel CPU.


# chkrootkit
<SNIP lots of nothing found/not infected/nothing detected>

$ uname -a
Linux marte 5.15.6-desktop-2.mga8 #1 SMP Sat Dec 4 17:31:49 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ rpm -q chkrootkit 
chkrootkit-0.55-1.mga8
Comment 12 Christophe Nanteuil 2021-12-17 07:59:22 CET
Great! Thanks.
Comment 13 Thomas Andrews 2021-12-18 19:56:12 CET
Validating.

Keywords: (none) => validated_update
CC: (none) => andrewsfarm, sysadmin-bugs

Thomas Backlund 2021-12-19 16:29:04 CET

Keywords: (none) => advisory

Comment 14 Mageia Robot 2021-12-19 17:14:44 CET
An update for this issue has been pushed to the Mageia Updates repository.

https://advisories.mageia.org/MGAA-2021-0233.html

Status: NEW => RESOLVED
Resolution: (none) => FIXED


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