[Bug binutils/26391] New: Question regarding duplicate symbols

2020-08-14 Thread kaccardi at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26391

Bug ID: 26391
   Summary: Question regarding duplicate symbols
   Product: binutils
   Version: unspecified
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: binutils
  Assignee: unassigned at sourceware dot org
  Reporter: kaccardi at gmail dot com
  Target Milestone: ---

I am implementing "function granular kernel address space layout randomization"
for Linux, and am trying to solve a problem that I am really hoping there is a
compiler or linker option for. My implementation uses gcc's -ffunction-sections
to break apart the kernel .text section by function. At kernel boot time, just
after decompression, I shuffle all the function sections randomly and re-layout
the kernel. Surprisingly, this works pretty well, but I am having a problem
with a niche condition that is important to resolve for the live-patching use
case. In order to live-patch the kernel, the live-patching code will request
the address of symbols by name from the kernel. This works great after
randomization because it always receives the current address at runtime rather
than relying on any kind of buildtime address. The issue with with the
live-patching code's algorithm for resolving duplicate symbol names. If they
request a symbol by name from the kernel and there are 3 symbols with the same
name, they use the symbol's position in the built binary image to select the
correct symbol. This is obviously invalid when the layout has been shuffled
randomly. I was hoping there was some kind of compiler or linker option that
would add some kind of uniqueness to the symbols to make sure their were never
any duplicates, but I am not finding such a thing. Is there something like this
already available? Thanks very much!

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26391] Question regarding duplicate symbols

2020-08-21 Thread kaccardi at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26391

--- Comment #2 from Kristen Carlson Accardi  ---
This works for me! Thanks!

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26391] Question regarding duplicate symbols

2020-09-09 Thread kaccardi at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26391

--- Comment #4 from Kristen Carlson Accardi  ---
This feature was well received by the livepatch maintainers. It not only solves
my individual problem, but also would allow them to more precisely locate
duplicate symbols in general for patching. I'd like to request that this
feature be implemented in a future release.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/26391] Question regarding duplicate symbols

2020-09-09 Thread kaccardi at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=26391

--- Comment #5 from Kristen Carlson Accardi  ---
https://lore.kernel.org/live-patching/4dc070f53f4f96b47dba4e4e51bb65d75f2071bb.ca...@linux.intel.com/T/#mb29f61d93a1f0307212053c90ab86cb9fe5a64ee

-- 
You are receiving this mail because:
You are on the CC list for the bug.