public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Coywolf Qi Hunt <coywolf@gmail.com>
To: Arjan van de Ven <arjan@infradead.org>
Cc: Josh Boyer <jdub@us.ibm.com>,
	linux-kernel@vger.kernel.org, ak@suse.de, akpm@osdl.org,
	coywolf@sosdg.org
Subject: Re: [patch 02/02] Debug option to write-protect rodata: the write protect logic and config option
Date: Sat, 12 Nov 2005 02:57:02 +0800	[thread overview]
Message-ID: <2cd57c900511111057n3a7741ddw@mail.gmail.com> (raw)
In-Reply-To: <1131702428.2833.8.camel@laptopd505.fenrus.org>

2005/11/11, Arjan van de Ven <arjan@infradead.org>:
> > people objecting to that.
> > >
> > > (It's not clear cut: while the last bit of the kernel no longer is
> > > covered by a 2Mb tlb, most intel cpus have very few of such tlbs in the
> > > first place and this would free up one such tlb for other things (say
> > > the stack data) or even the userspace database), so it's not all that
> > > clear cut what the cost of this is)
> >
> > I'm dumb. But how is "the last bit of the kernel no longer is covered
> > by a 2Mb tlb"? Could you explain a bit more?
>
> in memory it'll look something like this
>
> 0                 2                   4                         6
> -- kernel text -- + -- kernel text -- + --- k. text-- rodata -- + --
>
> normally the range from 0 to 6 is covered with 2Mb tlb's.
> Now to make rodata read only, the hugetlb entry covering 4-6 Mb range
> needs to be split into 4Kb entries, so that the rodata portion can have
> different permissions than the rest of that range.

Indeed. Thanks.

And we could also mark text section read-only and data/stack section
noexec if NX is supported. But I doubt the whole thing would really
help much. Kill the kernel thread? We can't. We only run into a panic.
Anyway I'd attach a quick patch to mark text section read only in the
next mail.

If it's ok, I'd add Kconfig support. Comments?
--
Coywolf Qi Hunt
http://sosdg.org/~coywolf/

  reply	other threads:[~2005-11-11 18:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-07 10:56 [patch 01/02] Debug option to write-protect rodata: change_page_attr fixes arjan
2005-11-07 10:58 ` [patch 02/02] Debug option to write-protect rodata: the write protect logic and config option arjan
2005-11-07 14:06   ` Josh Boyer
2005-11-07 14:20     ` Arjan van de Ven
2005-11-11  9:39       ` Coywolf Qi Hunt
2005-11-11  9:47         ` Arjan van de Ven
2005-11-11 18:57           ` Coywolf Qi Hunt [this message]
2005-11-11 19:04             ` [patch] mark text section read-only Coywolf Qi Hunt
2005-11-11 19:09               ` Arjan van de Ven
2005-11-11 19:34               ` linux-os (Dick Johnson)
2005-11-12 14:01                 ` Coywolf Qi Hunt
2005-11-11 21:43               ` Andi Kleen
2005-11-11 23:30                 ` Nikita Danilov
2005-11-12 17:26                   ` Andi Kleen
2005-11-12 14:32                 ` Coywolf Qi Hunt
2005-11-12 16:34                   ` Coywolf Qi Hunt
2005-11-13  4:50                     ` Keith Owens
2005-11-14 13:34               ` Linh Dang

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=2cd57c900511111057n3a7741ddw@mail.gmail.com \
    --to=coywolf@gmail.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=arjan@infradead.org \
    --cc=coywolf@sosdg.org \
    --cc=jdub@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    /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