You are not logged in.

#1 2014-02-19 09:29:01

bstaletic
Member
Registered: 2014-02-02
Posts: 658

linux-grsec kernel panic

I used aura to install linux-grsec, and after a while it said failed due to unresolved dependancies (gradm and linux-pax-flags). So I installed the two missing packages also using aura, and it finished without errors. Second installation of linux-grsec went also with no errors, but after reboot it gave me kernel panic.

Here is the photo of kernel panic:
grsec kernel panic]https://imagizer.ima … /c61m.jpg]

mod edit [ewaller] changed link to over sized picture to url link https://wiki.archlinux.org/index.php/Fo … s_and_Code

Last edited by ewaller (2014-02-19 14:15:46)

Offline

#2 2014-02-19 10:34:24

Rexilion
Member
Registered: 2013-12-23
Posts: 784

Re: linux-grsec kernel panic

That's a common and general error. It says that the initrd (it does exist I hope?) failed to mount and populate a new root. Did you regenerate your initrd?


fs/super.c : "Self-destruct in 5 seconds.  Have a nice day...\n",

Offline

#3 2014-02-19 10:38:32

bstaletic
Member
Registered: 2014-02-02
Posts: 658

Re: linux-grsec kernel panic

How can I check if initrd exists? And I didn't regenerate it.

Offline

#4 2014-02-19 11:44:33

Rexilion
Member
Registered: 2013-12-23
Posts: 784

Re: linux-grsec kernel panic

Check grub.cfg for the grsec kernel and see if that has an initrd line. Make sure that file exists. And try to regenerate it. mkinitcpio -k $(grsec uname -r) -g /boot/grsec-initrd.gz


fs/super.c : "Self-destruct in 5 seconds.  Have a nice day...\n",

Offline

#5 2014-02-19 12:51:59

bstaletic
Member
Registered: 2014-02-02
Posts: 658

Re: linux-grsec kernel panic

grub.cfg doesn't have the needed lines, although there are initramfs-linux-grsec.img and initramfs-linux-grsec-fallback.img files. When I run grub-mkconfig it doesn't recognize them at all. If I manually enter the lines in grub.cfg I'm able to boot, but unable to login in KDE, console logging works fine.

Offline

#6 2014-02-19 13:16:30

Rexilion
Member
Registered: 2013-12-23
Posts: 784

Re: linux-grsec kernel panic

I suggest you regenerate the initrd files. You do get to see KDM I hope?


fs/super.c : "Self-destruct in 5 seconds.  Have a nice day...\n",

Offline

#7 2014-02-19 13:24:34

bstaletic
Member
Registered: 2014-02-02
Posts: 658

Re: linux-grsec kernel panic

If I understood corretly I should enter "sudo mkinitcpio -k 3.13.3-2-grsec -g /boot/initramfs-linux-grsec.img"?
If so, than it didn't help.
I have a working default kernel, so I can boot Arch whenever I want to.

Offline

#8 2014-02-19 20:23:01

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: linux-grsec kernel panic

Not a Sysadmin issue, moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#9 2014-02-20 07:24:16

Rexilion
Member
Registered: 2013-12-23
Posts: 784

Re: linux-grsec kernel panic

I think you are not able to login to KDE because PaX is probably blocking something. You can check dmesg for that.


fs/super.c : "Self-destruct in 5 seconds.  Have a nice day...\n",

Offline

#10 2014-02-20 09:54:05

bstaletic
Member
Registered: 2014-02-02
Posts: 658

Re: linux-grsec kernel panic

What should I be looking for in dmesg, because it is pretty big report. I checked "journalctl -xb" and found these errors
(along with some samba and locale errors which I can easly fix):

grsec: time set by /usr/lib/systemd/systemd/[systemd:1] uid/euid:0/0, gid/egid:0/0, parent /[swapper/0:0] uid/euid:0/0, gid/egid:0/0
grsec: time set by /usr/lib/systemd/systemd/[systemd:1] uid/euid:0/0, gid/egid:0/0, parent /[swapper/0:0] uid/euid:0/0, gid/egid:0/0

and

grsec: denied marking stock executable as requested by PT_GNU_STACK marking in /usr/lib/libqimageblitz.so.4.0.0 by /usr/lib/kdeinit4[ksmserver:568] uid/euid:1000/1000 gid/egid:100/100, parent /usr/bin/kdeinit4[kdeinit4:515] uid/euid:1000/1000 gid/egid:100/100
grsec: denied RWX mprotect of /usr/lib/ld-2.19.so by /usr/bin/kdeinit4[ksmserver:568] uid/euid:1000:1000 gid/egid:100/100, parent /usr/bin/kdeinit4[kdeinit4:515] uid/euid:1000/1000 gid/egid:100/100

Offline

#11 2014-02-20 10:04:59

Rexilion
Member
Registered: 2013-12-23
Posts: 784

Re: linux-grsec kernel panic

The last one looks somewhat promising. But that is not how I remember how these messages looked like. It's more something like this:

[2396058.354252] PAX: execution attempt in: <anonymous mapping>, aa1d2000-aa1d5000 aa1d2000
[2396058.354259] PAX: terminating task: /usr/bin/gdb(gdb):15808, uid/euid: 1000/1000, PC: aa1d2000, SP: bb6d5690

In your case, it seems to mention that it honours some file specific ELF section. Which is good. But I'm probably mistaken.

I did some googling, your solution is probably here. Looks nice. It also mentions the kdeinit4 binary.


fs/super.c : "Self-destruct in 5 seconds.  Have a nice day...\n",

Offline

#12 2014-02-20 10:26:30

bstaletic
Member
Registered: 2014-02-02
Posts: 658

Re: linux-grsec kernel panic

I already have linux-pax-flags installed, it's a dependancy of grsecurity kernel. Tried reinstalling but it didn't give any results.

Offline

#13 2014-02-20 10:50:59

Rexilion
Member
Registered: 2013-12-23
Posts: 784

Re: linux-grsec kernel panic

Ah, that sheds some light how things got there in the first place.

It seems to me that the PT_GNU_STACK section is being replaced by PT_PAX_FLAGS. You could try this:

paxctl -c $(which kde4init)

But consult the manpage before doing so. Other than that, given that you did not compile your own kernel with a modified config, I'm out of ideas.


fs/super.c : "Self-destruct in 5 seconds.  Have a nice day...\n",

Offline

#14 2014-02-20 11:14:51

bstaletic
Member
Registered: 2014-02-02
Posts: 658

Re: linux-grsec kernel panic

After that command it doesn't jusst logout of kde it hangs (indefinitely) while trying to login. While in that state I am able to press ctrl+alt+f1, but if I return tu kde I'm stuck.
If I restart kde from tty using systemctl I get one more return to tty, but nothing more. This time journalctl didn't show previous errors, but it still says RWX denied on something new (didn't write it down).

If you want I will post exactly what the error is, but if you don't have any more ideas I will just uninstall it and continue running default kernel.
Anyway thanks for your time and help.

Offline

#15 2014-02-20 12:18:05

Rexilion
Member
Registered: 2013-12-23
Posts: 784

Re: linux-grsec kernel panic

The list of packages included quite some KDE binaries. Your login hanged on the next binary hit by this problem. You have to convert all binaries from PT_GNU_STACK to PT_PAX_FLAGS to  make it work. One method is trial and error (check dmesg). The other method is doing this for the entire system.

The binary your box hangs on has PT_GNU_STACK. One dangerous method is to scan the entire system for the GNU_STACK and convert it with paxctl if it exists. Another method which I post here does this uncondinionally:

find /usr/bin /usr/sbin /usr/lib -type f -print0 | xargs -0 paxctl -c

Make a backup of all your data. The program gives output like this:

file leafpad had a PT_GNU_STACK program header, converted

To be really honest, I have no idea how does old PT_GNU_STACK sections got there in the first place. Paxctl should not create those. Did you use chpax by any chance? Furthermore, did you modify the .config of the linux-grsec package?


fs/super.c : "Self-destruct in 5 seconds.  Have a nice day...\n",

Offline

#16 2014-02-20 12:36:20

bstaletic
Member
Registered: 2014-02-02
Posts: 658

Re: linux-grsec kernel panic

And back to kernel panic! big_smile

I had my data already backed up so I run the command you posted. Unfortunately it produced "kernel panic - not syncing: attempted to kill target!"

Here you can take a look at the output of kernel panic.

Last edited by bstaletic (2014-02-20 12:53:46)

Offline

#17 2014-02-20 13:41:08

Rexilion
Member
Registered: 2013-12-23
Posts: 784

Re: linux-grsec kernel panic

Good thing you had a back-up. Apparently, the command created the sections for files that did not have one and thereby activating the PaX protection on those files (oops).

This is going to take a lot of work to get right. You could boot into another non grsec kernel.

To fix this apparent issue, you should boot with a non PaX (GrSec) kernel and reinstall SystemD.


fs/super.c : "Self-destruct in 5 seconds.  Have a nice day...\n",

Offline

#18 2014-02-20 14:02:38

bstaletic
Member
Registered: 2014-02-02
Posts: 658

Re: linux-grsec kernel panic

Reinstalling systemd hasn't made anything better. If it doesn't boot after next suggestion I'm giving up. That is if you are up for more newb frienly kernel fixing.

Offline

#19 2014-02-20 14:14:35

Rexilion
Member
Registered: 2013-12-23
Posts: 784

Re: linux-grsec kernel panic

It did not change anything?

I'm sorry. With respect to using grsec, I screwed up. It seems that many library's/exec's do not contain a section for PaX at all. Now that I made you add them to almost every single file in the system, PaX is also activated for those. It could take days of nabbling with paxctl to restore that.

One last resort is this: Boot a non grsec kernel and do (you still have your backups righ?!?):

find /usr/bin /usr/sbin /usr/lib -type f -print0 | xargs -0 paxctl -pemrxs

That should allow you to boot with the grsec kernel (and login into KDE as well). Otherwise, I'm out of ideas. (and sorry for wrecking your installation with respect to pax markings).


fs/super.c : "Self-destruct in 5 seconds.  Have a nice day...\n",

Offline

#20 2014-02-20 14:30:10

bstaletic
Member
Registered: 2014-02-02
Posts: 658

Re: linux-grsec kernel panic

For most of the files it said something like "not a valid ELF executable", and would skip to the next file so it didn't fix anything. Thanks for the time and willingness to help me, but I'll happily switch back to stock kernel.

Once again thank you.

Last edited by bstaletic (2014-02-20 14:38:38)

Offline

#21 2014-02-20 14:52:20

Rexilion
Member
Registered: 2013-12-23
Posts: 784

Re: linux-grsec kernel panic

That is ok and expected. It works, because you don't see output when it does it's thing as intended.


fs/super.c : "Self-destruct in 5 seconds.  Have a nice day...\n",

Offline

#22 2014-02-20 14:57:25

bstaletic
Member
Registered: 2014-02-02
Posts: 658

Re: linux-grsec kernel panic

But I am still not able to boot grsec kernel.

Offline

Board footer

Powered by FluxBB