From: Shuah Khan <skhan@linuxfoundation.org>
To: Eugene Syromiatnikov <esyr@redhat.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>
Cc: Artem Savkov <asavkov@redhat.com>,
linux-sound@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org,
Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH] selftests/alsa/Makefile: fix relative rpath usage
Date: Thu, 8 Aug 2024 14:20:21 -0600 [thread overview]
Message-ID: <83d4e1a3-73fc-4634-b133-82b9e883b98b@linuxfoundation.org> (raw)
In-Reply-To: <20240808145639.GA20510@asgard.redhat.com>
On 8/8/24 08:57, Eugene Syromiatnikov wrote:
> The relative RPATH ("./") supplied to linker options in CFLAGS is resolved
> relative to current working directory and not the executable directory,
> which will lead in incorrect resolution when the test executables are run
> from elsewhere. Changing it to $ORIGIN makes it resolve relative
> to the directory in which the executables reside, which is supposedly
> the desired behaviour.
>
> Discovered by the check-rpaths script[1][2] that checks for insecure
> RPATH/RUNPATH[3], such as relative directories, during an attempt
> to package BPF selftests for later use in CI:
>
> ERROR 0004: file '/usr/libexec/kselftests/bpf/urandom_read' contains an insecure runpath '.' in [.]
>
> [1] https://github.com/rpm-software-management/rpm/blob/master/scripts/check-rpaths
> [2] https://github.com/rpm-software-management/rpm/blob/master/scripts/check-rpaths-worker
> [3] https://cwe.mitre.org/data/definitions/426.html
>
> Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
> ---
> tools/testing/selftests/alsa/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/alsa/Makefile b/tools/testing/selftests/alsa/Makefile
> index c1ce39874e2b..0f204da9ea8e 100644
> --- a/tools/testing/selftests/alsa/Makefile
> +++ b/tools/testing/selftests/alsa/Makefile
> @@ -6,7 +6,7 @@ LDLIBS += $(shell pkg-config --libs alsa)
> ifeq ($(LDLIBS),)
> LDLIBS += -lasound
> endif
> -CFLAGS += -L$(OUTPUT) -Wl,-rpath=./
> +CFLAGS += -L$(OUTPUT) -Wl,-rpath=\$$ORIGIN/
>
> LDLIBS+=-lpthread
>
Wouldn't make sense to fix fix this in selftests main Makefile
instead of changing the all the test makefiles
Same comment on all other files. It would be easier to send
these as series - please mentioned the tests run as well
after this change.
thanks,
-- Shuah
next prev parent reply other threads:[~2024-08-08 20:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-08 14:57 [PATCH] selftests/alsa/Makefile: fix relative rpath usage Eugene Syromiatnikov
2024-08-08 20:20 ` Shuah Khan [this message]
2024-08-09 1:00 ` Eugene Syromiatnikov
2024-08-09 17:01 ` Shuah Khan
2024-08-09 18:53 ` Eugene Syromiatnikov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83d4e1a3-73fc-4634-b133-82b9e883b98b@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=asavkov@redhat.com \
--cc=broonie@kernel.org \
--cc=esyr@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox