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


Groups > linux.kernel > #1304949

[RFC PATCH v3 1/6] Elf: add livepatch-specific Elf constants

From Jessica Yu <jeyu@redhat.com>
Newsgroups linux.kernel
Subject [RFC PATCH v3 1/6] Elf: add livepatch-specific Elf constants
Date 2016-01-08 20:30 +0100
Message-ID <qOKTw-2Pp-27@gated-at.bofh.it> (permalink)
References <qOKTv-2Pp-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Add livepatch Elf relocation section flag (SHF_RELA_LIVEPATCH), and symbol
section index (SHN_LIVEPATCH). The values of these Elf constants were
selected from OS-specific ranges according to the definitions from glibc.

Livepatch relocation sections are marked with SHF_RELA_LIVEPATCH to
indicate to the module loader that it should not apply that relocation
section and that livepatch will handle them.

The SHN_LIVEPATCH shndx marks symbols that will be resolved by livepatch.
The module loader ignores these symbols and does not attempt to resolve
them.

Signed-off-by: Jessica Yu <jeyu@redhat.com>
---
 include/uapi/linux/elf.h | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/include/uapi/linux/elf.h b/include/uapi/linux/elf.h
index 71e1d0e..cb4a72f 100644
--- a/include/uapi/linux/elf.h
+++ b/include/uapi/linux/elf.h
@@ -282,16 +282,18 @@ typedef struct elf64_phdr {
 #define SHT_HIUSER	0xffffffff
 
 /* sh_flags */
-#define SHF_WRITE	0x1
-#define SHF_ALLOC	0x2
-#define SHF_EXECINSTR	0x4
-#define SHF_MASKPROC	0xf0000000
+#define SHF_WRITE		0x1
+#define SHF_ALLOC		0x2
+#define SHF_EXECINSTR		0x4
+#define SHF_RELA_LIVEPATCH	0x00100000
+#define SHF_MASKPROC		0xf0000000
 
 /* special section indexes */
 #define SHN_UNDEF	0
 #define SHN_LORESERVE	0xff00
 #define SHN_LOPROC	0xff00
 #define SHN_HIPROC	0xff1f
+#define SHN_LIVEPATCH	0xff20
 #define SHN_ABS		0xfff1
 #define SHN_COMMON	0xfff2
 #define SHN_HIRESERVE	0xffff
-- 
2.4.3

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


Thread

[RFC PATCH v3 0/6] (mostly) Arch-independent livepatch Jessica Yu <jeyu@redhat.com> - 2016-01-08 20:30 +0100
  [RFC PATCH v3 1/6] Elf: add livepatch-specific Elf constants Jessica Yu <jeyu@redhat.com> - 2016-01-08 20:30 +0100
  [RFC PATCH v3 3/6] module: s390: keep mod_arch_specific for livepatch modules Jessica Yu <jeyu@redhat.com> - 2016-01-08 20:30 +0100
  [RFC PATCH v3 5/6] samples: livepatch: mark as livepatch module Jessica Yu <jeyu@redhat.com> - 2016-01-08 20:30 +0100
  [RFC PATCH v3 4/6] livepatch: reuse module loader code to write relocations Jessica Yu <jeyu@redhat.com> - 2016-01-08 20:40 +0100
    Re: [RFC PATCH v3 4/6] livepatch: reuse module loader code to write  relocations Petr Mladek <pmladek@suse.com> - 2016-01-11 18:00 +0100
      Re: [RFC PATCH v3 4/6] livepatch: reuse module loader code to write  relocations Josh Poimboeuf <jpoimboe@redhat.com> - 2016-01-11 22:00 +0100
    Re: [RFC PATCH v3 4/6] livepatch: reuse module loader code to write  relocations Josh Poimboeuf <jpoimboe@redhat.com> - 2016-01-11 22:40 +0100
      Re: livepatch: reuse module loader code to write relocations Jessica Yu <jeyu@redhat.com> - 2016-01-11 23:40 +0100
        Re: livepatch: reuse module loader code to write relocations Josh Poimboeuf <jpoimboe@redhat.com> - 2016-01-12 04:10 +0100
          Re: livepatch: reuse module loader code to write relocations Petr Mladek <pmladek@suse.com> - 2016-01-12 10:20 +0100
          Re: livepatch: reuse module loader code to write relocations Jessica Yu <jeyu@redhat.com> - 2016-01-14 06:10 +0100
    Re: [RFC PATCH v3 4/6] livepatch: reuse module loader code to write  relocations Miroslav Benes <mbenes@suse.cz> - 2016-01-12 17:50 +0100
      Re: livepatch: reuse module loader code to write relocations Jessica Yu <jeyu@redhat.com> - 2016-01-14 05:00 +0100
        Re: livepatch: reuse module loader code to write relocations Miroslav Benes <mbenes@suse.cz> - 2016-01-14 10:10 +0100
    Re: [RFC PATCH v3 4/6] livepatch: reuse module loader code to write  relocations Miroslav Benes <mbenes@suse.cz> - 2016-01-13 10:20 +0100
      Re: [RFC PATCH v3 4/6] livepatch: reuse module loader code to write  relocations Jiri Kosina <jikos@kernel.org> - 2016-01-13 10:40 +0100
      Re: livepatch: reuse module loader code to write relocations Jessica Yu <jeyu@redhat.com> - 2016-01-13 19:40 +0100
        Re: livepatch: reuse module loader code to write relocations Miroslav Benes <mbenes@suse.cz> - 2016-01-14 10:20 +0100

csiph-web