Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 29 Jun 2017 17:04:46 -0700
From: Kees Cook <keescook@...omium.org>
To: Arnd Bergmann <arnd@...db.de>
Cc: Kernel Hardening <kernel-hardening@...ts.openwall.com>, Laura Abbott <labbott@...hat.com>, 
	"the arch/x86 maintainers" <x86@...nel.org>, Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 04/20] gcc-plugins: Add the randstruct plugin

On Thu, Jun 29, 2017 at 3:53 PM, Kees Cook <keescook@...omium.org> wrote:
> I see a few possible solutions:

Or this ugly hack:

diff --git a/include/linux/sched.h b/include/linux/sched.h
index e2ad3531e7fe..5d131f9f1dac 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -749,6 +749,19 @@ struct task_struct {
        /* Namespaces: */
        struct nsproxy                  *nsproxy;

+#ifdef CONFIG_ARM
+       /*
+        * Since task_struct is gigantic, some asmoffset locations
+        * (e.g. TSK_STACK_CANARY) for a randomized field may exceed
+        * an architecture's instruction immediate values. As a
+        * work-around to avoid changing the performance characteristics
+        * of the assembly, split the randomization into two groups,
+        * keeping the "early" fields within range of the immediates.
+        */
+       randomized_struct_fields_end
+       randomized_struct_fields_start
+#endif
+
        /* Signal handlers: */
        struct signal_struct            *signal;
        struct sighand_struct           *sighand;


I suspect updating the ARM assembly (CONFIG-conditionally) to accept
>4095 offsets is probably the best solution.

-Kees

-- 
Kees Cook
Pixel Security

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.