From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E150E156237 for ; Thu, 8 Aug 2024 20:20:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148424; cv=none; b=JlP3dKvD2B/UqCFJCHupqWJKJr6otnaNwxCPVqaMpbxNTYZAa6XIp49dlTsMoNZ4XjDEzn87agogU+dPg450uvoGAjSedkjOqyFHq0vjZZwlgz5+EK6z5D2Gl6S72QxuWrVbTVBqOEWfNmyCW77XGAYdUc64c9vjmqUaxrs7+Uw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148424; c=relaxed/simple; bh=I8tXjScfs6SfIGBVAqBjUPUpXxLI8X5aEotWs/mSdR8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=PtDcvoLPLdpqWzF3n4NmOueym6dYdEbJvEGMWPZB7kG0vVIonVA0nMhcq668gB/WGN0S4Wr079N7iccR8Yov9MRQLN1XCm4rFFbofEzhpDqv50LmMx+QGhFv6rKElV3EoqTUWRZeIhzpTLoCosfXxsIlsVjpgqf4vbkjQ8PXx8U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=PcFcxTCw; arc=none smtp.client-ip=209.85.166.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="PcFcxTCw" Received: by mail-il1-f172.google.com with SMTP id e9e14a558f8ab-3989f6acc90so650745ab.3 for ; Thu, 08 Aug 2024 13:20:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; t=1723148422; x=1723753222; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=QfQLxAkKJO0OxN3PoS9gfcknEgVgOQSzt4mX6LsWfm0=; b=PcFcxTCwrhV66d4QWXs78cB/g8PLFxqohmvRsKq2yvWs5ANyMMfScdXdr6Gm5uKzQl qwN8ADwovIu3wuNKzlZQhTMt1ypJ8O3YCKHbRVe0m6o4VSYVBiGkmfq4o0DYGMva5/er baOinfv0LhQvvQpMdNlWfhzqzxoYtjJJyJXa0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723148422; x=1723753222; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QfQLxAkKJO0OxN3PoS9gfcknEgVgOQSzt4mX6LsWfm0=; b=fywLzPiRFBOPA3Y7hHupXTkfHsrF/9rd0G4yLw1aEPqwVkr3edH1sxgOYkjoNQoLDN rWF7y6pBj0KPegRsk6Zcb+V2N2NuF6k+Jhw7gM1bTGux+FdXVrxAARsjbd1l4KPta8BV BiTVHdUTL39Bzt+Mj/1uoIe3fWvZ/6il1UAGkc3+4nk9B+leD8GYgAkMNrm6dvH5TMX1 Igug+fy1bsajnqDyiIRvucK3chQR13Z2+WN7lxS7ggYJxapck+85rOpB7mPAOHpItcZc zCwcdQX3XtyZRWKoMVNzdbG1jlKL/k+j1mPgAtQm/fw9zImY4b0rdbFYFy/1MVxNODUE 0qRg== X-Forwarded-Encrypted: i=1; AJvYcCUVKU0H2kAu4ifdCXUzy+g7YbI1wgczGm+0SXK0BI1iEPSIWUV3tUlpmuGFlDzep+LUOvnP67Q/TYp2lbfEn6fM2IH5MLF7ul5DNdzk X-Gm-Message-State: AOJu0Yy4Yob/DVqTfkNDi8KCLkXxvcd4XPb6DpnhZS6LEu34hAcebPh/ l7yhphJpj6A4rhTj4GitNwjm6fPUZnhF1eRONNhJD/SDGGA/zMV5kAeQmoJf0lA= X-Google-Smtp-Source: AGHT+IFz2Q8BNZhb/hkrGYq+MEEYJykLer5kY5z3ptVsISOpOwy8Tnb8XprZ34ZhF4rcXiEOjQWgxA== X-Received: by 2002:a05:6e02:1aa2:b0:39a:eac8:9be8 with SMTP id e9e14a558f8ab-39b5ec71b5amr23752905ab.1.1723148422046; Thu, 08 Aug 2024 13:20:22 -0700 (PDT) Received: from [192.168.1.128] ([38.175.170.29]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-39b20ae34d0sm56676835ab.56.2024.08.08.13.20.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Aug 2024 13:20:21 -0700 (PDT) Message-ID: <83d4e1a3-73fc-4634-b133-82b9e883b98b@linuxfoundation.org> Date: Thu, 8 Aug 2024 14:20:21 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] selftests/alsa/Makefile: fix relative rpath usage To: Eugene Syromiatnikov , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: Artem Savkov , linux-sound@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan References: <20240808145639.GA20510@asgard.redhat.com> Content-Language: en-US From: Shuah Khan In-Reply-To: <20240808145639.GA20510@asgard.redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 > --- > 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