public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/arm/morello/main] cheri: elf: add an RW capability to link_map
@ 2022-10-27 13:55 Szabolcs Nagy
  0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-10-27 13:55 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c511eea647f5f4ccf65a817da746bb10f4bbc2cf

commit c511eea647f5f4ccf65a817da746bb10f4bbc2cf
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Mon Aug 8 09:22:44 2022 +0100

    cheri: elf: add an RW capability to link_map
    
    For each module keep an RX and an RW root capability.  Use the existing
    l_map_start for RX (covering all load segments) and add l_rw_start for
    RW (covering all writable load segments).
    
    For relocation processing, we also need individual RW ranges to decide
    which objects need to be derived from RW and RX capabilities.  In
    practice most modules have exactly one RW segment and it's unlikely
    that any module needs more than four distinct ranges to tightly cover
    the RW mappings.
    
    Only added on CHERI targets so always has to be used behind ifdef.

Diff:
---
 include/link.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/include/link.h b/include/link.h
index 7632ae33d3..79c8a57690 100644
--- a/include/link.h
+++ b/include/link.h
@@ -256,6 +256,18 @@ struct link_map
     ElfW(Addr) l_map_end;
     /* End of the executable part of the mapping.  */
     ElfW(Addr) l_text_end;
+#ifdef __CHERI_PURE_CAPABILITY__
+    /* Writable part of the mapping (may have non-writable holes).  */
+    elfptr_t l_rw_start;
+# define DL_MAX_RW_COUNT 4
+    /* Writable ranges: objects are writable in these ranges.  */
+    int l_rw_count;
+    struct rw_range
+    {
+      ElfW(Addr) start;
+      ElfW(Addr) end;
+    } l_rw_range[DL_MAX_RW_COUNT];
+#endif
 
     /* Default array for 'l_scope'.  */
     struct r_scope_elem *l_scope_mem[4];

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

* [glibc/arm/morello/main] cheri: elf: add an RW capability to link_map
@ 2022-11-23 14:45 Szabolcs Nagy
  0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-11-23 14:45 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f70a0f9a14ebb996d2d914b3067e6fcf4faf5ee0

commit f70a0f9a14ebb996d2d914b3067e6fcf4faf5ee0
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Mon Aug 8 09:22:44 2022 +0100

    cheri: elf: add an RW capability to link_map
    
    For each module keep an RX and an RW root capability.  Use the existing
    l_map_start for RX (covering all load segments) and add l_rw_start for
    RW (covering all writable load segments).
    
    For relocation processing, we also need individual RW ranges to decide
    which objects need to be derived from RW and RX capabilities.  In
    practice most modules have exactly one RW segment and it's unlikely
    that any module needs more than four distinct ranges to tightly cover
    the RW mappings.
    
    Only added on CHERI targets so always has to be used behind ifdef.

Diff:
---
 include/link.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/include/link.h b/include/link.h
index 7632ae33d3..79c8a57690 100644
--- a/include/link.h
+++ b/include/link.h
@@ -256,6 +256,18 @@ struct link_map
     ElfW(Addr) l_map_end;
     /* End of the executable part of the mapping.  */
     ElfW(Addr) l_text_end;
+#ifdef __CHERI_PURE_CAPABILITY__
+    /* Writable part of the mapping (may have non-writable holes).  */
+    elfptr_t l_rw_start;
+# define DL_MAX_RW_COUNT 4
+    /* Writable ranges: objects are writable in these ranges.  */
+    int l_rw_count;
+    struct rw_range
+    {
+      ElfW(Addr) start;
+      ElfW(Addr) end;
+    } l_rw_range[DL_MAX_RW_COUNT];
+#endif
 
     /* Default array for 'l_scope'.  */
     struct r_scope_elem *l_scope_mem[4];

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

* [glibc/arm/morello/main] cheri: elf: add an RW capability to link_map
@ 2022-10-26 15:16 Szabolcs Nagy
  0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-10-26 15:16 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e836294c7947f2c7f3f8b50d518605ae6c487aa2

commit e836294c7947f2c7f3f8b50d518605ae6c487aa2
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Mon Aug 8 09:22:44 2022 +0100

    cheri: elf: add an RW capability to link_map
    
    For each module keep an RX and an RW root capability.  Use the existing
    l_map_start for RX (covering all load segments) and add l_rw_start for
    RW (covering all writable load segments).
    
    For relocation processing, we also need individual RW ranges to decide
    which objects need to be derived from RW and RX capabilities.  In
    practice most modules have exactly one RW segment and it's unlikely
    that any module needs more than four distinct ranges to tightly cover
    the RW mappings.
    
    Only added on CHERI targets so always has to be used behind ifdef.

Diff:
---
 include/link.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/include/link.h b/include/link.h
index 7632ae33d3..79c8a57690 100644
--- a/include/link.h
+++ b/include/link.h
@@ -256,6 +256,18 @@ struct link_map
     ElfW(Addr) l_map_end;
     /* End of the executable part of the mapping.  */
     ElfW(Addr) l_text_end;
+#ifdef __CHERI_PURE_CAPABILITY__
+    /* Writable part of the mapping (may have non-writable holes).  */
+    elfptr_t l_rw_start;
+# define DL_MAX_RW_COUNT 4
+    /* Writable ranges: objects are writable in these ranges.  */
+    int l_rw_count;
+    struct rw_range
+    {
+      ElfW(Addr) start;
+      ElfW(Addr) end;
+    } l_rw_range[DL_MAX_RW_COUNT];
+#endif
 
     /* Default array for 'l_scope'.  */
     struct r_scope_elem *l_scope_mem[4];

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

* [glibc/arm/morello/main] cheri: elf: add an RW capability to link_map
@ 2022-10-12 14:17 Szabolcs Nagy
  0 siblings, 0 replies; 4+ messages in thread
From: Szabolcs Nagy @ 2022-10-12 14:17 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=55ada9157de78b614f56169643942f31d36b0035

commit 55ada9157de78b614f56169643942f31d36b0035
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Mon Aug 8 09:22:44 2022 +0100

    cheri: elf: add an RW capability to link_map
    
    For each module keep an RX and an RW root capability.  Use the existing
    l_map_start for RX (covering all load segments) and add l_rw_start for
    RW (covering all writable load segments).
    
    For relocation processing, we also need individual RW ranges to decide
    which objects need to be derived from RW and RX capabilities.  In
    practice most modules have exactly one RW segment and it's unlikely
    that any module needs more than four distinct ranges to tightly cover
    the RW mappings.
    
    Only added on CHERI targets so always has to be used behind ifdef.

Diff:
---
 include/link.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/include/link.h b/include/link.h
index 6dd8e712c4..e1dca89762 100644
--- a/include/link.h
+++ b/include/link.h
@@ -257,6 +257,18 @@ struct link_map
     ElfW(Addr) l_map_end;
     /* End of the executable part of the mapping.  */
     ElfW(Addr) l_text_end;
+#ifdef __CHERI_PURE_CAPABILITY__
+    /* Writable part of the mapping (may have non-writable holes).  */
+    elfptr_t l_rw_start;
+# define DL_MAX_RW_COUNT 4
+    /* Writable ranges: objects are writable in these ranges.  */
+    int l_rw_count;
+    struct rw_range
+    {
+      ElfW(Addr) start;
+      ElfW(Addr) end;
+    } l_rw_range[DL_MAX_RW_COUNT];
+#endif
 
     /* Default array for 'l_scope'.  */
     struct r_scope_elem *l_scope_mem[4];

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

end of thread, other threads:[~2022-11-23 14:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-27 13:55 [glibc/arm/morello/main] cheri: elf: add an RW capability to link_map Szabolcs Nagy
  -- strict thread matches above, loose matches on Subject: below --
2022-11-23 14:45 Szabolcs Nagy
2022-10-26 15:16 Szabolcs Nagy
2022-10-12 14:17 Szabolcs Nagy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).