Bug 154844 - LibreOffice won't run on HardenedBSD because uses its path /usr/local/lib/libreoffice/program
Summary: LibreOffice won't run on HardenedBSD because uses its path /usr/local/lib/lib...
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.5.2.2 release
Hardware: x86-64 (AMD64) FreeBSD
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: QA:needsComment
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-16 16:01 UTC by vujo
Modified: 2023-05-01 03:19 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vujo 2023-04-16 16:01:32 UTC
Description:
Hi.
From the news https://hardenedbsd.org/article/shawn-webb/2022-06-28/hardenedbsd-june-2022-status-report

-----
I plan to MFC all of the above to 13-STABLE soon. If you build your own packages or ports, please take special note of item four above. Here's a few more details on how we've hardened the RTLD (when hardening.harden_rtld is set to 1):

    LD_PRELOAD is fully prohibited.
    Set dangerous_ld_env, which isn't used much in the RTLD, but could be used more in the future.
    Sensitive LD_* environment variables are scrubbed.
    Using the RTLD to execute applications is prohibited.
    Tracing of loaded objects is prohibited. This change in particular breaks ldd(1), which is used by a lot of ports during the build process. This is what can cause the most headaches.
-----

it says that a new parameter hardening.harden_rtld has been added
By default hardening.harden_rtld parameter is 1
in this case libreoffice does not start

# libreoffice
ld-elf.so.1: Shared object "libuno_sal.so.3" not found, required by "oosplash"

# pkg info -l libreoffice | grep libuno_sal.so.3
/usr/local/lib/libreoffice/program/libuno_sal.so.3

# ldd /usr/local/lib/libreoffice/program/oosplash
/usr/local/lib/libreoffice/program/oosplash:
ld-elf.so.1: Tainted process refusing to run binary /libexec/ld-elf.so.1
/usr/local/lib/libreoffice/program/oosplash: exit status 1

If set hardening.harden_rtld: 0
then libreoffice starts correctly

# ldd /usr/local/lib/libreoffice/program/oosplash
/usr/local/lib/libreoffice/program/oosplash:
libXinerama.so.1 => /usr/local/lib/libXinerama.so.1 (0x1a0d1ae2000)
libX11.so.6 => /usr/local/lib/libX11.so.6 (0x1a0d1ae7000)
libpng16.so.16 => /usr/local/lib/libpng16.so.16 (0x1a0d1c43000)
libuno_sal.so.3 => /usr/local/lib/libreoffice/program/libuno_sal.so.3 (0x1a0d1c87000)
libthr.so.3 => /lib/libthr.so.3 (0x1a0d1d04000)
libc.so.7 => /lib/libc.so.7 (0x1a0d1d31000)
libXext.so.6 => /usr/local/lib/libXext.so.6 (0x1a0d213d000)
libxcb.so.1 => /usr/local/lib/libxcb.so.1 (0x1a0d2154000)
libz.so.6 => /lib/libz.so.6 (0x1a0d2187000)
libm.so.5 => /lib/libm.so.5 (0x1a0d21a4000)
libc++.so.1 => /usr/lib/libc++.so.1 (0x1a0d21e0000)
libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x1a0d22e8000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x1a0d230a000)
libXau.so.6 => /usr/local/lib/libXau.so.6 (0x1a0d2324000)
libXdmcp.so.6 => /usr/local/lib/libXdmcp.so.6 (0x1a0d232a000)
[vdso] (0x7fdbd1562000)



Я создал тикет для обсуждения данной проблемы на hardenedbsd.org:
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD/-/issues/86


Steps to Reproduce:
1. Run "libreoffice"


Actual Results:
# libreoffice
ld-elf.so.1: Shared object "libuno_sal.so.3" not found, required by "oosplash"

Expected Results:
Successful launch of libreoffice


Reproducible: Always


User Profile Reset: Yes

Additional Info:
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD/-/issues/86