[LTP] [PATCH 08/10] Add landlock04 test
Li Wang
liwang@redhat.com
Thu Jul 4 03:53:45 CEST 2024
Andrea Cervesato <andrea.cervesato@suse.com> wrote:
> +# the reason why landlock_exec test binary is statically linked, is that
>>> +# we can't read libc out of the sandboxed folder once
>>> LANDLOCK_ACCESS_FS_EXECUTE
>>> +# has been activated
>>> +landlock_exec: LDLIBS += -static -fPIC
>>>
>>
> And, if we decided to build the program as static, we'd better
> adding glibc-static into the dependency list, otherwise it always
> failed to link the binary on RHEL distributions.
>
> We found a solution for this. We compile landlock_exec with dynamic
> linking, then we apply READ + EXEC rules to /lib and /lib64.
> In this way we can easily execute the binary and we don't need more LTP
> dependences.
>
Sounds good.
--
Regards,
Li Wang
More information about the ltp
mailing list