mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chris Wright <chrisw@sous-sol.org>
To: Yan <rottled@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Comprehensive list of kernel self-modifications?
Date: Thu, 1 May 2008 17:38:45 -0700	[thread overview]
Message-ID: <20080502003842.GP30511@sequoia.sous-sol.org> (raw)
In-Reply-To: <54b90fdf0805011246v64d28c7ao8eb848419890d20a@mail.gmail.com>

* Yan (rottled@gmail.com) wrote:
> I have been working on verifying kernel integrity and am trying to
> differentiate
> between vmlinux image on disk and the kernel loaded into memory. I understand
>  that the kernel modifies itself (on x86 at least) during at least a few points:
> 
> 
> 1. It applies alternative instructions with apply_alternatives() from
> check_bugs().
>     The locations of all alternatives are found between __alt_instructions and
>     __alt_instructions__end.

Similarly, there's apply_paravirt() for CONFIG_PARAVIRT kernels.
(Also kprobes, or anything that calls text_poke(), but I doubt it's what
you're looking for).

> 2. It also applies what looks to be relocation. I see the list of
> reloc addresses at
>     the end of vmlinux image and it appears that relocate_kernel in
> relocate_kernel.S
>     applies the relocations. I can't tell how it knows where the list
> of addresses that
>     need relocations is found. Nothing that I found points to that
> area, and the on-
>     disk data seems to live what gets mapped to as BSS when its running.

BSS?  It's not on disk outside of elf header and mapped and cleared at
startup (see clear_bss, for example).

  reply	other threads:[~2008-05-02  0:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-01 19:46 Yan
2008-05-02  0:38 ` Chris Wright [this message]
2008-05-14 14:42 ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080502003842.GP30511@sequoia.sous-sol.org \
    --to=chrisw@sous-sol.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rottled@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®