Coder Social home page Coder Social logo

Comments (2)

citrus-it avatar citrus-it commented on July 29, 2024

If I modify the lx brand so that it does not map lx_vdso, the zone boots and the memory map looks like this:

    7fffef288000     7fffef2c0000            38000 /zones/lx/root/usr/lib/systemd/systemd
    7fffef2c0000     7fffef3af000            ef000 /zones/lx/root/usr/lib/systemd/systemd
    7fffef3af000     7fffef415000            66000 /zones/lx/root/usr/lib/systemd/systemd
    7fffef415000     7fffef45e000            49000 /zones/lx/root/usr/lib/systemd/systemd
    7fffef45e000     7fffef45f000             1000 /zones/lx/root/usr/lib/systemd/systemd
    7fffef460000     7fffef461000             1000 [ unknown ]

and pmap shows the flags:

00007FFFEF288000        224K r----  /zones/lx/root/usr/lib/systemd/systemd
00007FFFEF2C0000        956K r-x--  /zones/lx/root/usr/lib/systemd/systemd
00007FFFEF3AF000        408K r----  /zones/lx/root/usr/lib/systemd/systemd
00007FFFEF415000        292K r----  /zones/lx/root/usr/lib/systemd/systemd
00007FFFEF45E000          4K rw---  /zones/lx/root/usr/lib/systemd/systemd
00007FFFEF460000          4K r--s-

from illumos-omnios.

citrus-it avatar citrus-it commented on July 29, 2024

The following change in glibc changed the way that the runtime linker decides whether to relocate a section:

commit b413280cfb16834450f66f554bc0d618bb513851
Author: H.J. Lu <[email protected]>
Date:   Thu Sep 16 08:15:29 2021 -0700

    ld.so: Replace DL_RO_DYN_SECTION with dl_relocate_ld [BZ #28340]

    We can't relocate entries in dynamic section if it is readonly:

    1. Add a l_ld_readonly field to struct link_map to indicate if dynamic
    section is readonly and set it based on p_flags of PT_DYNAMIC segment.
    2. Replace DL_RO_DYN_SECTION with dl_relocate_ld to decide if dynamic
    section should be relocated.

and it seems that the lx_vdso.so libraries do have the PF_W flag set on the dynamic section:

bloody:illumos:master% elfedit -re 'phdr:p_flags 2' i386/lx_vdso.so.1

Program header [1]:
    p_vaddr:      0x74        p_flags:    [ PF_X PF_W PF_R ]
    p_paddr:      0           p_type:     [ PT_DYNAMIC ]
    p_filesz:     0x100       p_memsz:    0
    p_offset:     0x74        p_align:    0
bloody:illumos:master% elfedit -re 'phdr:p_flags 2' amd64/lx_vdso.so.1

Program header [1]:
    p_vaddr:      0xe8                p_flags:    [ PF_W PF_R ]
    p_paddr:      0                   p_type:     [ PT_DYNAMIC ]
    p_filesz:     0x200               p_memsz:    0
    p_offset:     0xe8                p_align:    0

Patching these with elfedit to remove the PF_W flag resolves the problem and the lx zone can boot (both centos stream 9 and fedora 35)

from illumos-omnios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.