Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new kernel check should check for a kernel #128

Open
benformosa opened this issue Jul 15, 2019 · 0 comments
Open

new kernel check should check for a kernel #128

benformosa opened this issue Jul 15, 2019 · 0 comments
Labels
bug effort/medium Can be done in 1-2 days gain/medium Affects multiple users

Comments

@benformosa
Copy link

I've noticed that tracer incorrectly reports that a new kernel is available on systems which have kernel modules installed for other kernel versions.

I have a RHEL 7.6 system with CommVault agent installed, which has installed a kernel module for every kernel supported by that software.
See https://documentation.commvault.com/commvault/v11/article?p=1940.htm

I have two kernels installed, and am running the latest:

$ rpm -qa kernel
kernel-3.10.0-957.21.2.el7.x86_64
kernel-3.10.0-957.21.3.el7.x86_64
$ uname -r
3.10.0-957.21.3.el7.x86_64

Here's the contents of the modules directory for the latest kernel:

$ find /lib/modules/$(uname -r) -maxdepth 1
/lib/modules/3.10.0-957.21.3.el7.x86_64
/lib/modules/3.10.0-957.21.3.el7.x86_64/build
/lib/modules/3.10.0-957.21.3.el7.x86_64/extra
/lib/modules/3.10.0-957.21.3.el7.x86_64/kernel
/lib/modules/3.10.0-957.21.3.el7.x86_64/modules.block
/lib/modules/3.10.0-957.21.3.el7.x86_64/modules.builtin
/lib/modules/3.10.0-957.21.3.el7.x86_64/modules.drm
/lib/modules/3.10.0-957.21.3.el7.x86_64/modules.modesetting
/lib/modules/3.10.0-957.21.3.el7.x86_64/modules.networking
/lib/modules/3.10.0-957.21.3.el7.x86_64/modules.order
/lib/modules/3.10.0-957.21.3.el7.x86_64/source
/lib/modules/3.10.0-957.21.3.el7.x86_64/updates
/lib/modules/3.10.0-957.21.3.el7.x86_64/vdso
/lib/modules/3.10.0-957.21.3.el7.x86_64/weak-updates
/lib/modules/3.10.0-957.21.3.el7.x86_64/modules.dep
/lib/modules/3.10.0-957.21.3.el7.x86_64/modules.dep.bin
/lib/modules/3.10.0-957.21.3.el7.x86_64/modules.symbols
/lib/modules/3.10.0-957.21.3.el7.x86_64/modules.symbols.bin
/lib/modules/3.10.0-957.21.3.el7.x86_64/weak
/lib/modules/3.10.0-957.21.3.el7.x86_64/modules.builtin.bin
/lib/modules/3.10.0-957.21.3.el7.x86_64/modules.alias
/lib/modules/3.10.0-957.21.3.el7.x86_64/modules.alias.bin
/lib/modules/3.10.0-957.21.3.el7.x86_64/modules.softdep
/lib/modules/3.10.0-957.21.3.el7.x86_64/modules.devname

And here's the contents of the modules directory for what tracer detects as a newer kernel:

$ find /lib/modules/3.12.49-11-default
/lib/modules/3.12.49-11-default
/lib/modules/3.12.49-11-default/extra
/lib/modules/3.12.49-11-default/extra/cdr.ko
/lib/modules/3.12.49-11-default/extra/cvblk.ko
/lib/modules/3.12.49-11-default/extra/cvbf.ko

Here's an idea of a fix to check for the presence of a 'kernel' directory.
https://github.com/FrostyX/tracer/blob/master/tracer/resources/tracer.py#L132

def _has_updated_kernel(self):
    if os.path.isdir('/lib/modules/'):
            for k_version in next(os.walk('/lib/modules/'))[1]:
                    if parse_version(os.uname()[2]) < parse_version(k_version) and os.path.isdir(os.path.join('/lib/modules/', k_version, 'kernel')):
                            return True
            return False
    return False
@FrostyX FrostyX added the bug label Nov 26, 2023
@FrostyX FrostyX added this to the False-positives milestone Nov 26, 2023
@FrostyX FrostyX added effort/medium Can be done in 1-2 days gain/medium Affects multiple users labels Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug effort/medium Can be done in 1-2 days gain/medium Affects multiple users
Projects
None yet
Development

No branches or pull requests

2 participants