public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/6] kernel ASLR
@ 2013-04-26 19:03 Kees Cook
  2013-04-26 19:03 ` [PATCH 1/6] x86: kaslr: move ELF relocation handling to C Kees Cook
                   ` (5 more replies)
  0 siblings, 6 replies; 24+ messages in thread
From: Kees Cook @ 2013-04-26 19:03 UTC (permalink / raw)
  To: linux-kernel
  Cc: kernel-hardening, H. Peter Anvin, Thomas Gleixner, Ingo Molnar,
	x86, Jarkko Sakkinen, Matthew Garrett, Matt Fleming, Eric Northup,
	Dan Rosenberg, Julien Tinnes, Will Drewry, Kees Cook

This series includes various small cleanups noted in the individual
patches. Further work will include 64-bit separation of physical and
virtual memory locations.

-Kees


^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: [PATCH 5/6] x86: kaslr: select memory region from e820 maps
@ 2013-04-26 20:07 George Spelvin
  0 siblings, 0 replies; 24+ messages in thread
From: George Spelvin @ 2013-04-26 20:07 UTC (permalink / raw)
  To: keescook; +Cc: linux, linux-kernel

As a logic simplification, the following gets rid of one variable
that's simply not needed.  (And adds a "static" declaration that seems
to be appropriate):

static bool largest_ram_region(unsigned long *start, unsigned long *size)
{
	int i;

	*size = 0;
	for (i = 0; i < real_mode->e820_entries; i++) {
		struct e820entry *entry = &real_mode->e820_map[i];

		if (entry->type != E820_RAM)
			continue;

		if (entry->size > *size) {
			*size = entry->size;
			*start = entry->addr;
		}
	}
	return *size != 0;
}

but I might instead do it as:

struct e820_entry const *largest_ram_region()
{
	struct e820_entry const *rc = NULL;
	unsigned long size = 0;
	int i;

	for (i = 0; i < real_mode->e820_entries; i++) {
		struct e820entry const *entry = &real_mode->e820_map[i];

		if (entry->type == E820_RAM && entry->size > size) {
			size = entry->size;
			rc = entry;
		}
	}
	return rc;
}

... with appropriate adjustments to the caller.  Anyway,
your choice.

^ permalink raw reply	[flat|nested] 24+ messages in thread
* [PATCH v3 0/6] kernel ASLR
@ 2013-04-25 21:54 Kees Cook
  2013-04-25 21:54 ` [PATCH 5/6] x86: kaslr: select memory region from e820 maps Kees Cook
  0 siblings, 1 reply; 24+ messages in thread
From: Kees Cook @ 2013-04-25 21:54 UTC (permalink / raw)
  To: linux-kernel
  Cc: kernel-hardening, H. Peter Anvin, Thomas Gleixner, Ingo Molnar,
	x86, Jarkko Sakkinen, Matthew Garrett, Matt Fleming, Eric Northup,
	Dan Rosenberg, Julien Tinnes, Will Drewry, Kees Cook

This continues to build on the tip/kaslr patches for KASLR. This series
converts the logic to C, and moves both relocation and address selection
into the decompress_kernel path. Several areas were refactored to allow
for some code reuse (e.g. CPU flags, kernel command line).

This does not yet attempt to rework the page tables to handle an arbitrary
physical memory location on x86_64. I would love some suggestions on
how to do this. :)

-Kees


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2013-04-29 19:15 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-26 19:03 [PATCH v4 0/6] kernel ASLR Kees Cook
2013-04-26 19:03 ` [PATCH 1/6] x86: kaslr: move ELF relocation handling to C Kees Cook
2013-04-26 19:03 ` [PATCH 2/6] x86: kaslr: move CPU flags out of cpucheck Kees Cook
2013-04-26 21:47   ` H. Peter Anvin
2013-04-26 22:14     ` H. Peter Anvin
2013-04-29 17:49       ` Kees Cook
2013-04-29 17:52         ` Kees Cook
2013-04-26 19:03 ` [PATCH 3/6] x86: kaslr: return location from decompress_kernel Kees Cook
2013-04-26 21:47   ` H. Peter Anvin
2013-04-29  1:25     ` [kernel-hardening] " James Morris
2013-04-29 17:43       ` Kees Cook
2013-04-26 19:03 ` [PATCH 4/6] x86: kaslr: select random base offset Kees Cook
2013-04-26 21:50   ` H. Peter Anvin
2013-04-29 19:15     ` Kees Cook
2013-04-26 19:03 ` [PATCH 5/6] x86: kaslr: select memory region from e820 maps Kees Cook
2013-04-26 21:51   ` Yinghai Lu
2013-04-26 22:01     ` H. Peter Anvin
2013-04-26 22:01     ` Kees Cook
2013-04-26 19:03 ` [PATCH 6/6] x86: kaslr: report kernel offset on panic Kees Cook
2013-04-26 22:13   ` Borislav Petkov
2013-04-26 22:15     ` H. Peter Anvin
2013-04-26 22:19       ` Borislav Petkov
  -- strict thread matches above, loose matches on Subject: below --
2013-04-26 20:07 [PATCH 5/6] x86: kaslr: select memory region from e820 maps George Spelvin
2013-04-25 21:54 [PATCH v3 0/6] kernel ASLR Kees Cook
2013-04-25 21:54 ` [PATCH 5/6] x86: kaslr: select memory region from e820 maps Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox