Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp124053lqb; Tue, 16 Apr 2024 10:28:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVUD/QFl4q/Gtfi3jaYE3rNCNZgsBXYALDt7WcMbBzNtMayvye9wt3tJ+Oj1Se7CXO4VwWn+9U2/P46jcFm1ObdvmKDf3AUn65s5ub6dA== X-Google-Smtp-Source: AGHT+IHneWHA1M73coq6ONzPcFRF4F1ctTBgbHzDSQQHJbKu4+Gaj7/49oJqW8lh0Qro5OgPOo9U X-Received: by 2002:a05:620a:4144:b0:78e:fd6f:2ea7 with SMTP id k4-20020a05620a414400b0078efd6f2ea7mr220901qko.63.1713288492304; Tue, 16 Apr 2024 10:28:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713288492; cv=pass; d=google.com; s=arc-20160816; b=ihvr/KaYYekFh+AK5++d5w3C3Zb1AcQnaaCqX2oMe+fBpUdcHVMRqiWhZz7ZfnsidJ Vs883b0gwTFdrFXaP1QDRXA+WaNDVedOTZZhN3RUY5HX8jhUPcmOujYcvhn+mzJB0snD p8Yxzrz0lzWzOSEFphA05aoyATz2n35QbDw48qJlsRJ2bgvlMzV/z+4thc3hOyC2aNgW 053UoM1DSVCFJA+0YyiNi9fKproXpYZYGGjSb3UURsB2OQr/tRhr2BFlunT3Gm+cZLSt dMuyTA3cZoZrU6AbodJeEAXyBQITCIR87bNMIZ3d6aR6633sawLDt9k7Y6vImD2nbPjL v93A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=CbYixWM2CqQRL1wOMDrzHbCtgA+kuvvqBpiFHzx5mPI=; fh=Btyj2ibSnqc+qpqHDyjn+2kanPTij/eV2Hi16Tbq0hM=; b=pI+ksZMzdCJB+pl5nerkuz4rSEXYtLhIxxJLnizHYU5OVQf94YDFI1oX6rVbG0iu06 1DK/RTbdpki+roRaEiBL05ZZdaW+NtqiPWtyLYnWJA+hPWTzEZISaCknomKbT+YeVuTu 5AFviE3uxjC9hniKrG/H1Q/rCXk+b1QWLQ4hEq4rqAYKGm50Cn5aNHXvPLGiJ0jj33Lb 0YCpfPvWjR0MX66UaQBGt4s4vYbsDikgvI2LBEpWzbT1UxSvulruqf9FKp4wuuIHu3PU R+mgmp+bSzoqTW/HxwFUbNVfnDvmJ4gd9e4FbuS8p+Y3G9NFvbZ+dlVo1AgBtfNCRjDR pGbQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=T3Jz4KJm; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-147308-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147308-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h20-20020a05620a245400b0078ec5d50191si13824051qkn.341.2024.04.16.10.28.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 10:28:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147308-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=T3Jz4KJm; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-147308-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147308-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 0AE0A1C2152E for ; Tue, 16 Apr 2024 17:28:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 99C8E1332B8; Tue, 16 Apr 2024 17:28:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="T3Jz4KJm" Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) (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 8B25713280C for ; Tue, 16 Apr 2024 17:28:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713288485; cv=none; b=laWV4IDC2ozt4MPkguPaybRIh353H7VD+yMslGC3iN9Er+0IV17ALTOwpy3Vdne9PxeyLh8ZtLK6lW1al5PlEoK/oxBKIaXRrWMuRo9UANX2zCqoG+osQvuPHb0u4sonwcQghTbIeWdGKVUMBLH4UnfFZoPGndzIo0MMHhDkUcc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713288485; c=relaxed/simple; bh=P9tX21C2H32XeRZpclyE1jUdcQxT5hx7EiLUM0Xs90o=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZvdWRHdi62cHm/MPFtbTyIvV3KVJMqby4rAD+LABt1Rb/wau2rgJGRKquPmCix3sYIg7092DJCrSmQ1XUOHY9SyZm4zQgFM6ta2e1kao96xYiU3UzolMd8rmsRg+GDydldOWf2Qf8P2qN0NYJUgnIlUOWq8pg5Ppc+VWj9TOxCc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=T3Jz4KJm; arc=none smtp.client-ip=209.85.215.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-5cddfe0cb64so2677528a12.0 for ; Tue, 16 Apr 2024 10:28:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713288484; x=1713893284; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=CbYixWM2CqQRL1wOMDrzHbCtgA+kuvvqBpiFHzx5mPI=; b=T3Jz4KJmnyq/mTIRQ0mnFEDpa8wKySv7YgYqQnu9UivT9y7iBBrKCtqCHQ9AwQcjcI 46vAdaph0tV8XogvavUwHlrPVsiXkEa8VxHf4SauwBJFTdvRYB3+CFHAheCf4HilFJ2u iqGTZAHqZZto8HFgVIoteloaIQ3+r4azZG3YI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713288484; x=1713893284; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=CbYixWM2CqQRL1wOMDrzHbCtgA+kuvvqBpiFHzx5mPI=; b=T1ZcPdWvn16MIvqKFaDAM3Y/37V72tncJLyjjrWOjiBfWJnJIblNZGL8wMkzd8Aaib AgLaldecYsnWInQK+ugPBMJXpri5yGyLe5U6EU+GhQh+JBRLJh0qGxLfg28r2vBK21nW /x4tfN2kZJTuHzwosDddYoeW+3BrirXexH/j18QYV0ZBnx1JyHOA21xW5Iu737AspTSq krf3uuFGrN/cMGwfY8bW11E1O6tyeqbzPYsUXgx0c8Dfb6b7dxuFEozfO1lo4jxKCgXK 1BSdTL33s7jQDqDIBbbmzA4C9D3td58CbvZm6iOMt8H4GP9Ldf+1v0ewERvRMbdv0uOa kjJA== X-Forwarded-Encrypted: i=1; AJvYcCXbkSLyjirOKr3BCBH6G/r9jHt19xtFUPTehIc9vR44ifzqgFPQWDPYIKaezqt08xPspAsZREOJ6oMLofVYRYqAuqT5npCMU0rnXPCG X-Gm-Message-State: AOJu0YxGzEN38ghoBlPIgwmWxLxswaoDwyOW1te+m8UR3Z/h+38u7Zml ivEoOrdQBSa77LIiIkzsBnc0SBxf5uOp1TWS4jhzDkYy75RJCew3Qizd0OomJw== X-Received: by 2002:a17:90b:3bc7:b0:2a2:672f:ef6d with SMTP id ph7-20020a17090b3bc700b002a2672fef6dmr10647646pjb.49.1713288483774; Tue, 16 Apr 2024 10:28:03 -0700 (PDT) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id h16-20020a17090a051000b002a2e4b593cdsm11862530pjh.51.2024.04.16.10.28.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 10:28:03 -0700 (PDT) Date: Tue, 16 Apr 2024 10:28:02 -0700 From: Kees Cook To: Muhammad Usama Anjum Cc: Eric Biederman , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Andrew Morton , Yang Yingliang , kernel@collabora.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH v2] selftests: exec: make binaries position independent Message-ID: <202404161027.63F4D4FDEB@keescook> References: <20240416152831.3199999-1-usama.anjum@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240416152831.3199999-1-usama.anjum@collabora.com> On Tue, Apr 16, 2024 at 08:28:29PM +0500, Muhammad Usama Anjum wrote: > The -static overrides the -pie and binaries aren't position independent > anymore. Use -static-pie instead which would produce a static and > position independent binary. This has been caught by clang's warnings: > > clang: warning: argument unused during compilation: '-pie' > [-Wunused-command-line-argument] > > Tested with both gcc and clang after this change. > > Fixes: 4d1cd3b2c5c1 ("tools/testing/selftests/exec: fix link error") > Signed-off-by: Muhammad Usama Anjum Thanks for this! Reviewed-by: Kees Cook -- Kees Cook