Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1669947

[PATCH 3/4] randstruct: Disable randomization of ACPICA structs

From Kees Cook <keescook@chromium.org>
Newsgroups linux.kernel
Subject [PATCH 3/4] randstruct: Disable randomization of ACPICA structs
Date 2017-06-19 23:00 +0200
Message-ID <tUbWa-7E3-19@gated-at.bofh.it> (permalink)
References <tUbW9-7E3-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Since the ACPICA source is maintained externally to the kernel, we can
neither switch it to designated initializers nor mark it
__no_randomize_layout. Until ACPICA-upstream changes[1] land to handle the
designated initialization, explicitly skip it in the plugin.

[1] https://github.com/acpica/acpica/pull/248

Signed-off-by: Kees Cook <keescook@chromium.org>
---
 scripts/gcc-plugins/randomize_layout_plugin.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/gcc-plugins/randomize_layout_plugin.c b/scripts/gcc-plugins/randomize_layout_plugin.c
index f777ead58ba8..e6e02a40d522 100644
--- a/scripts/gcc-plugins/randomize_layout_plugin.c
+++ b/scripts/gcc-plugins/randomize_layout_plugin.c
@@ -346,6 +346,10 @@ static int relayout_struct(tree type)
 	    !strcmp((const char *)ORIG_TYPE_NAME(type), "RAWPCIFACTORY"))
 		return 0;
 
+	/* Skip ACPICA structs until refreshed with designated_init. */
+	if (!strcmp((const char *)ORIG_TYPE_NAME(type), "acpi_sleep_functions"))
+		return 0;
+
 	/* throw out any structs in uapi */
 	xloc = expand_location(DECL_SOURCE_LOCATION(TYPE_FIELDS(type)));
 
-- 
2.7.4

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 3/4] randstruct: Disable randomization of ACPICA structs Kees Cook <keescook@chromium.org> - 2017-06-19 23:00 +0200
  Re: [PATCH 3/4] randstruct: Disable randomization of ACPICA structs Christoph Hellwig <hch@infradead.org> - 2017-06-20 09:00 +0200
    Re: [PATCH 3/4] randstruct: Disable randomization of ACPICA structs Kees Cook <keescook@chromium.org> - 2017-06-20 21:30 +0200
      Re: [PATCH 3/4] randstruct: Disable randomization of ACPICA structs Christoph Hellwig <hch@infradead.org> - 2017-06-20 22:40 +0200
        Re: [PATCH 3/4] randstruct: Disable randomization of ACPICA structs "Rafael J. Wysocki" <rafael@kernel.org> - 2017-06-20 23:00 +0200
        Re: [PATCH 3/4] randstruct: Disable randomization of ACPICA structs "Rafael J. Wysocki" <rafael@kernel.org> - 2017-06-20 23:40 +0200
          Re: [PATCH 3/4] randstruct: Disable randomization of ACPICA structs Kees Cook <keescook@chromium.org> - 2017-06-23 02:00 +0200
            Re: [PATCH 3/4] randstruct: Disable randomization of ACPICA structs "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-06-23 02:10 +0200
              Re: [PATCH 3/4] randstruct: Disable randomization of ACPICA structs Kees Cook <keescook@chromium.org> - 2017-06-23 02:30 +0200

csiph-web