lynis icon indicating copy to clipboard operation
lynis copied to clipboard

Lynis asking to reboot when old kernels are installed

Open cristianrz opened this issue 2 years ago • 3 comments

Describe the bug

I have installed an older version of the kernel but the one active is the latest one, yet Lynis thinks system needs a reboot.

Version

  • Distribution: Alma Linux
  • Lynis version 3.0.7

Expected behavior

Lynis checks if there's any installed kernel NEWER than the current one.

Output

2022-01-18 18:15:18 Performing test ID KRNL-5830 (Checking if system is running on the latest installed kernel)
2022-01-18 18:15:18 Test: Checking presence /var/run/reboot-required.pkgs
2022-01-18 18:15:18 Result: file /var/run/reboot-required.pkgs not found
2022-01-18 18:15:18 Result: /boot exists, performing more tests from here
2022-01-18 18:15:18 Result: found /boot/vmlinuz-4.18.0-348.el8.x86_64
2022-01-18 18:15:18 Result: version derived from file name is '4.18.0-348.el8.x86_64'
2022-01-18 18:15:18 Result: found version 4.18.0-348.el8.x86_64
2022-01-18 18:15:18 Result: active kernel version 4.18.0-348.7.1.el8_5.x86_64
2022-01-18 18:15:18 Result: reboot needed, as there is a difference between active kernel and the one on disk
2022-01-18 18:15:18 Result: /var/cache/apt/archives/ does not exist
2022-01-18 18:15:18 Warning: Reboot of system is most likely needed [test:KRNL-5830] [details:] [solution:text:reboot]

cristianrz avatar Jan 18 '22 18:01 cristianrz

Thanks for reporting. If you reboot you still get the same message?

mboelen avatar Jan 31 '22 22:01 mboelen

yup, same message, no matter how many times I restarted. Not sure how it calculates which Kernel is newer but I'm thinking it might be due to the name being 348.el[...] rather than 348.0? Just thinking out loud

cristianrz avatar Feb 07 '22 13:02 cristianrz

I’m also encountering this issue on Manjaro with Lynis 3.0.9. Looks like the version derived from /boot/vmlinuz-linux-* file name: “6.5-x86_64” is not exactly the same as the version from uname -r: “6.5.9-1-MANJARO”

2023-11-08 09:53:38 Performing test ID KRNL-5830 (Checking if system is running on the latest installed kernel)
2023-11-08 09:53:38 Test: Checking presence /var/run/reboot-required.pkgs
2023-11-08 09:53:38 Result: file /var/run/reboot-required.pkgs not found
2023-11-08 09:53:38 Test: Checking presence /var/run/needs_restarting
2023-11-08 09:53:38 Result: file /var/run/needs_restarting not found
2023-11-08 09:53:38 Result: /boot exists, performing more tests from here
2023-11-08 09:53:38 Result: found /boot/vmlinuz-6.5-x86_64
2023-11-08 09:53:38 Result: version derived from file name is '6.5-x86_64'
2023-11-08 09:53:38 Result: found version 6.5-x86_64
2023-11-08 09:53:38 Result: active kernel version 6.5.9-1-MANJARO
2023-11-08 09:53:38 Result: reboot needed, as there is a difference between active kernel and the one on disk
2023-11-08 09:53:38 Result: /var/cache/apt/archives/ does not exist
2023-11-08 09:53:38 Warning: Reboot of system is most likely needed [test:KRNL-5830] [details:] [solution:text:reboot]
2023-11-08 09:53:38 Hardening: assigned partial number of hardening points (0 of 5). Currently having 10 points (out of 19)
2023-11-08 09:53:38 Security check: file is normal

MFTabriz avatar Nov 08 '23 09:11 MFTabriz