Quantcast
Channel: Active questions tagged kali-linux - Super User
Viewing all articles
Browse latest Browse all 511

Kernel panic after failed attempt to update kernel in Kali Linux

$
0
0
  • Host OS: macOS Sonoma 14.1
  • Hypervisor: Parallels 19.1.0 (54729)
  • Guest OS: Kali 6.1.0

I have a Kali Linux VM that I run on Parallels that I use to do Hack The Box, CTFs, etc. Usually once a month, I run sudo apt update and sudo apt upgrade. The upgrade was taking a little longer than usual, and I think the reason was it because it was trying to upgrade the kernel to 6.5.0. Right at the end as the upgrade finished, I noticed some installation errors relating to the packages for the new kernel (didn't get an screenshots unfortunately). I wasn't really sure what to make of them, so I restarted.

This led to a kernel panic. I ran into something like this before when Parallels Tools forced a restart during an upgrade. So I booted into the older kernel (6.1.0), confirmed with uname -r that I was on 6.1.0, and listed out the installed kernels with dpkg --list | grep linux-image and saw:

Results of dpkg --list | grep linux-image:

┌──(matt㉿kali)-[~]└─$ uname -r6.1.0-kali9-amd64┌──(matt㉿kali)-[~]└─$ dpkg --list | grep linux-imagerc  linux-image-5.15.0-kali3-amd64           5.15.15-2kali1              amd64        Linux 5.15 for 64-bit PCsrc  linux-image-5.16.0-kali3-amd64           5.16.11-1kali1              amd64        Linux 5.16 for 64-bit PCsrc  linux-image-5.16.0-kali5-amd64           5.16.14-1kali1              amd64        Linux 5.16 for 64-bit PCsrc  linux-image-5.16.0-kali7-amd64           5.16.18-1kali1              amd64        Linux 5.16 for 64-bit PCsrc  linux-image-5.17.0-kali3-amd64           5.17.11-1kali1              amd64        Linux 5.17 for 64-bit PCsrc  linux-image-5.18.0-kali5-amd64           5.18.5-1kali6               amd64        Linux 5.18 for 64-bit PCsrc  linux-image-5.18.0-kali7-amd64           5.18.16-1kali1              amd64        Linux 5.18 for 64-bit PCsii  linux-image-5.19.0-kali2-amd64           5.19.11-1kali2              amd64        Linux 5.19 for 64-bit PCsii  linux-image-6.0.0-kali3-amd64            6.0.7-1kali1                amd64        Linux 6.0 for 64-bit PCsii  linux-image-6.0.0-kali5-amd64            6.0.10-2kali1               amd64        Linux 6.0 for 64-bit PCsii  linux-image-6.0.0-kali6-amd64            6.0.12-1kali1               amd64        Linux 6.0 for 64-bit PCsii  linux-image-6.1.0-kali5-amd64            6.1.12-1kali2               amd64        Linux 6.1 for 64-bit PCsii  linux-image-6.1.0-kali7-amd64            6.1.20-2kali1               amd64        Linux 6.1 for 64-bit PCsii  linux-image-6.1.0-kali9-amd64            6.1.27-1kali1               amd64        Linux 6.1 for 64-bit PCsic  linux-image-6.5.0-kali3-amd64            6.5.6-1kali1                amd64        Linux 6.5 for 64-bit PCsic  linux-image-amd64                        6.5.6-1kali1                amd64        Linux for 64-bit PCs (meta-package)┌──(matt㉿kali)-[~]└─$

I tried to remove the 6.5.0 kernel which I assume was corrupted using sudo apt remove --purge linux-image-6.5.0-kali3-amd64. It failed, and I noticed the error was very similar to the one I saw when the initial upgrade failed:

Found initrd image: /boot/initrd.img-6.0.0-kali5-amd64Found linux image: /boot/vmlinuz-6.0.0-kali3-amd64Found initrd image: /boot/initrd.img-6.0.0-kali3-amd64Found linux image: /boot/vmlinuz-5.19.0-kali2-amd64Found initrd image: /boot/initrd.img-5.19.0-kali2-amd64Warning: os-prober will not be executed to detect other bootable partitions.Systems on them will not be added to the GRUB boot configuration.Check GRUB_DISABLE_OS_PROBER documentation entry.doneSetting up linux-headers-6.5.0-kali3-amd64 (6.5.6-1kali1) .../etc/kernel/header_postinst.d/dkms:dkms: running auto installation service for kernel 6.5.0-kali3-amd64.The kernel is be built without module signing facility, modules won't be signedBuilding module:Cleaning build area...make -j2 KERNELRELEASE=6.5.0-kali3-amd64 -f Makefile.kmods KSRC=/lib/modules/6.5.0-kali3-amd64/build KVER=6.5.0-kali3-amd64....(bad exit status: 2)Error! Bad return status for module build on kernel: 6.5.0-kali3-amd64 (x86_64)Consult /var/lib/dkms/parallels-tools/19.0.0.54570/build/make.log for more information.dkms autoinstall on 6.5.0-kali3-amd64/x86_64 failed for parallels-tools(10)Error! One or more modules failed to install during autoinstall.Refer to previous errors for more information.dkms: autoinstall for kernel: 6.5.0-kali3-amd64 failed!run-parts: /etc/kernel/header_postinst.d/dkms exited with return code 11Failed to process /etc/kernel/header_postinst.d at /var/lib/dpkg/info/linux-headers-6.5.0-kali3-amd64.postinst line 11.dpkg: error processing package linux-headers-6.5.0-kali3-amd64 (--configure):installed linux-headers-6.5.0-kali3-amd64 package post-installation script subprocess returned error exit status 1dpkg: dependency problems prevent configuration of linux-headers-amd64:linux-headers-amd64 depends on linux-headers-6.5.0-kali3-amd64 (= 6.5.6-1kali1); however:Package linux-headers-6.5.0-kali3-amd64 is not configured yet.dpkg: error processing package linux-headers-amd64 (--configure):dependency problems - leaving unconfiguredErrors were encountered while processing:linux-headers-6.5.0-kali3-amd64linux-headers-amd64needrestart is being skipped since dpkg has failedE: Sub-process /usr/bin/dpkg returned an error code (1)

I wasn't sure what to make of these errors, but I checked out the log file (seen in the second screenshot) and saw:

DKMS make.log for parallels-tools-19.0.0.54570 for kernel 6.5.0-kali3-amd64 (x86_64)Mon Oct 30 09:38:09 PM EDT 2023Will use compiler CC="gcc-13".Compiler version "gcc-13 (Debian 13.2.0-4) 13.2.0"cd prl_tg/Toolgate/Guest/Linux/prl_tg && make CC=gcc-13make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.make[1]: Entering directory '/var/lib/dkms/parallels-tools/19.0.0.54570/build/prl_tg/Toolgate/Guest/Linux/prl_tg'1: /lib/modules/6.5.0-kali3-amd64/build2: /var/lib/dkms/parallels-tools/19.0.0.54570/build/prl_tg/Toolgate/Guest/Linux/prl_tg3: 202310304: 1.10.2Start compile prl_tg...make -C /lib/modules/6.5.0-kali3-amd64/build M=/var/lib/dkms/parallels-tools/19.0.0.54570/build/prl_tg/Toolgate/Guest/Linux/prl_tg SRCROOT=/var/lib/dkms/parallels-tools/19.0.0.54570/build/prl_tg/Toolgate/Guest/Linux/prl_tg CC=gcc-13 modulesmake[2]: Entering directory '/usr/src/linux-headers-6.5.0-kali3-amd64'1: /lib/modules/6.5.0-kali3-amd64/build2: /var/lib/dkms/parallels-tools/19.0.0.54570/build/prl_tg/Toolgate/Guest/Linux/prl_tg3: 202310304: 1.10.2CC [M] /var/lib/dkms/parallels-tools/19.0.0.54570/build/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.oCC [M] /var/lib/dkms/parallels-tools/19.0.0.54570/build/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_call.oIn file included from /var/lib/dkms/parallels-tools/19.0.0.54570/build/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_common.h:25,from /var/lib/dkms/parallels-tools/19.0.0.54570/build/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_call.c:11:/var/lib/dkms/parallels-tools/19.0.0.54570/build/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_call.c: In function ‘tg_req_map_user_pages’:/var/lib/dkms/parallels-tools/19.0.0.54570/build/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_compat.h:63:17: error: too many arguments to function ‘get_user_pages’63 | get_user_pages(_1, _2, (_3) ? FOLL_WRITE : 0, _4, _5)| ^~~~~~~~~~~~~~/var/lib/dkms/parallels-tools/19.0.0.54570/build/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_call.c:126:15: note: in expansion of macro ‘prl_get_user_pages’126 | got = prl_get_user_pages(| ^~~~~~~~~~~~~~~~~~In file included from /usr/src/linux-headers-6.5.0-kali3-common/include/linux/scatterlist.h:8,from /usr/src/linux-headers-6.5.0-kali3-common/include/linux/dmapool.h:14,from /usr/src/linux-headers-6.5.0-kali3-common/include/linux/pci.h:1621,from /var/lib/dkms/parallels-tools/19.0.0.54570/build/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_call.c:7:/usr/src/linux-headers-6.5.0-kali3-common/include/linux/mm.h:2430:6: note: declared here2430 | long get_user_pages(unsigned long start, unsigned long nr_pages,| ^~~~~~~~~~~~~~make[4]: *** [/usr/src/linux-headers-6.5.0-kali3-common/scripts/Makefile.build:248: /var/lib/dkms/parallels-tools/19.0.0.54570/build/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg_call.o] Error 1make[3]: *** [/usr/src/linux-headers-6.5.0-kali3-common/Makefile:2059: /var/lib/dkms/parallels-tools/19.0.0.54570/build/prl_tg/Toolgate/Guest/Linux/prl_tg] Error 2make[2]: *** [/usr/src/linux-headers-6.5.0-kali3-common/Makefile:246: __sub-make] Error 2make[2]: Leaving directory '/usr/src/linux-headers-6.5.0-kali3-amd64'make[1]: *** [Makefile:44: prl_tg] Error 2make[1]: Leaving directory '/var/lib/dkms/parallels-tools/19.0.0.54570/build/prl_tg/Toolgate/Guest/Linux/prl_tg'make: *** [Makefile.kmods:48: compile] Error 2

I didn't really know what any of this meant. I'm under the assumption that Parallels Tools was trying to compile the kernel, but there was some sort of error. So I decided to try and uninstall Parallels Tools. This was easier said than done but I eventually got it uninstalled. Then I tried to remove the 6.5.0 kernel again which worked:

Apt Remove Success

I ran update-grub2 and rebooted. Everything went fine, and I tried to upgrade again to see if 6.5.0 would install correctly. But, the new kernel was not pulled in an installed. In fact, apt seemed to be under the impression that 6.1.0 was the most up to date kernel (it said as much in its output). I ran apt show linux-image-6.5.0-kali3-amd64 and it returned all the info about the package. So it seems apt is aware of the new kernel, but not that it is the newest and should be pulled in. I wasn't sure why this was happening, and I tried to do some research but I wasn't sure what to Google. So I have a few questions:

Why did the kernel panic occur initially?

Did I take the right steps to fix it? Is there anything else I should have done?

Why won't the new kernel install and how can fix it?

I'm by no means a Linux expert, so I want to understand how to handle these issues, like kernel panics, in the future without panic Googling and just running random commands. I definitely need to build some more of that sysadmin type knowledge.


Viewing all articles
Browse latest Browse all 511

Trending Articles