Skip to contentSkip to conversation

Kernel Rootkits

DISCUSSION Allison 2 participants 2 messages Apr 15, 2005

lore
Share & tools
lore

Allison

author
#0 lore raw

Isn't the kernel code segment marked read-only ? How can the module write into the function text in the kernel ? Shouldn't this cause some kind of protection fault ?

thanks,
Allison

Quoted 14 lines · Lee Revell
Quoted 2 lines · Allison

Once these are loaded into the kernel, is there no way the kernel functions can be protected ?

No. If the attacker can load arbitrary code into the kernel, game over. Think about it.

Lee

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#1 lore raw
Quoted 3 lines · Allison

Isn't the kernel code segment marked read-only ? How can the module write into the function text in the kernel ? Shouldn't this cause some kind of protection fault ?

The kernel code segment is totally unacessible to userspace programs, and to kernel itself, is marked read-write. A module runs at kernel level, so, it has +rw to kernel memory. Each process has a task structure that defines the top of memory that the user process can access (current->fs). In normal processes, this is 0xbfffff (the last adressable memory in user mode). After that, 0xc00000, starts the kernel code. If, by using any method, a user process receives a (current->fs = KERNEL_DS), it will be able to fully access the kernel memory. As mentioned, this is unsual.

Signature · 1 line
# (perl -e "while (1) { print "\x90"; }") | dd of=/dev/evil