Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp618495lqh; Sat, 4 May 2024 15:24:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUALosTi9Qg8xo9/nQB4lqL5rdNW8n2dn4UQ5CAsZjCA8GjPBx9QHg99RbkozY3zgkTBmnne35FleV4rF497ACjWjlm1GWERXxHUvIdyw== X-Google-Smtp-Source: AGHT+IFelZfd+yAUH/LHTjqKgSVi/qsC+WslhP+5SaazcSJ1vB72ZDSYq9P+LKK+TzuhzEPtDTQT X-Received: by 2002:a05:6214:518f:b0:6a0:d2dc:bbe1 with SMTP id kl15-20020a056214518f00b006a0d2dcbbe1mr6609073qvb.52.1714861452100; Sat, 04 May 2024 15:24:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714861452; cv=pass; d=google.com; s=arc-20160816; b=Kl8eE1k3kaO/97wGMdFIEjdFtrGbQAwZbcZI1Cgkyieqcf+TLDmQKshaPI4W9xYm3I xCvLFbQ9AFzE/M5wrec59vogoh0kemDDzQY2mpQYz/Yrfezb0lru7eLuI84z5CzNO5t7 AmrKRVHjfxn+8lvJnDYdEl7uEPN22uzPN+3brp/OyzDGBOeWnllqXRPM1RIQDmQIbB1b sMNLyPg/w5/AdUfEim41Dg6QKNKX1DakwywUMfT4hwuSzc/nlwwEkZE/NJY08fmvcpng 8mG5WVVZxhxhIGndgXTzC0IJRuRYxTeRnxJFMDGweuSLIlRJ6misef98CpSW0zyUwt0j 8mvQ== 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=YGLuo8OMl4BE5UMq7VCJIkfjPV5g9muPIovpwnBcSak=; fh=JyR+nsNNFeVDRoKdapdUnsu9QJjNaKX1LvJPYLYGJak=; b=jTJCT/0K5hhXDBADOH2j5eNqhyrdhksd8xodw2x9ORkDhT0gYTtEOxpoNZHpqWNko+ Kug+9thK+HYDY1zBtFP5jgoLGNXcX3yTBf4lFYyck48egqDMwub/6PZIP2Nfs6AAXft7 /XmlP515pFgUXWqAJ5m3tfK3eOI39Ul+NvbEcVNEo6+O2uhZqgf57Ey3U+pLb4cOa7Ch WMt7mxH39vv255G0i2RP1sqFbnAjrDtCRMgv7JYGmVdt6KUKMx0/krZv+wsZB/LUkTDk Bh7lsRECvf3lh9xOEHkVpstCtCaKXGpR9Xza3EFwNoMLxtShBGV6KhXB2g0n+furF8H+ Z4HA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oLliaO20; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-168843-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168843-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 10-20020ad45baa000000b006a0cb30aaa3si6188678qvq.25.2024.05.04.15.24.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 May 2024 15:24:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-168843-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=@kernel.org header.s=k20201202 header.b=oLliaO20; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-168843-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-168843-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 CE8D91C20BD3 for ; Sat, 4 May 2024 22:24:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 77ABF84DFB; Sat, 4 May 2024 22:24:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oLliaO20" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 990257580E; Sat, 4 May 2024 22:24:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714861444; cv=none; b=MMMDzV9TI5XCQp1YW22Hwfa1KjzPB8ICh+9z2ExAG7XNIsXFrbS+8NfGnrPHnQDGMNO2X1RMpxS4xeui7L3HKskFaAZFzOYabx7cjIRG7qI+QYz0XOu1zGsJ9XIYnoLoiZK2MAcukK3i90pGUbNRwkbpt1UMFYAzTvh/HHei5Mg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714861444; c=relaxed/simple; bh=HinZjebuSrqPkb/wLqws6KDk1bX5GIUlA5DoM/oka8g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BNstS6TNMX6M0YGXPFmyL/aRDqQCCa3bsYhheblYeAmAPLU5Y28nXdkXyxkjepvqnHLMKiwaWYqMvnA+pTtIoKorMKP2HCJ2TsfD/ZVR9AbLtqVo8u1x757zNBICEUmZ7HqUF1gIIAEPHscG7inOI4+6EwP7Se3ljFaQNduuAMs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oLliaO20; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B74E8C072AA; Sat, 4 May 2024 22:24:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714861444; bh=HinZjebuSrqPkb/wLqws6KDk1bX5GIUlA5DoM/oka8g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oLliaO20JYD0uoAJk8EEs5xuplcthyQh82T21DlxKq8XQ+WQnbn6N6LOJxD6fhsIj k9ymM9wjLcQ7vPGjSINPHe3iJFlDtuEAD/XGSKubCcgyWaK2iZofhTECx/ZlPpBU5Z qqOtEYC7wkvkjPxNPyzeisc6+EjlcYOvcDAcOkEnvZO4qDL6LnqbehSGr+4I5U1IAG 43wOri2Z/IPIIeoeoVCu7O++4lLuBRNS+sbdiNBb2jgzH7oHpl6vQ9HuUtnIN4VYTe gLlQs8GwnBtjoUjRJqTzWaE+YhnbRXAdv1iZYvN6iDNsneI2vAPXHE5fRXRJ6DLhdS dRayEajZaAxGw== Date: Sat, 4 May 2024 15:24:02 -0700 From: Josh Poimboeuf To: Kees Cook Cc: Peter Zijlstra , Youling Tang , Jinyang He , Huacai Chen , Tiezhu Yang , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] objtool: Provide origin hint for elf_init_reloc_text_sym() errors Message-ID: <20240504222402.p24zt6dc2zkyxqti@treble> References: <20240430235106.work.680-kees@kernel.org> 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=utf-8 Content-Disposition: inline In-Reply-To: <20240430235106.work.680-kees@kernel.org> On Tue, Apr 30, 2024 at 04:51:07PM -0700, Kees Cook wrote: > @@ -891,8 +892,8 @@ struct reloc *elf_init_reloc_text_sym(struct elf *elf, struct section *sec, > int addend = insn_off; > > if (!(insn_sec->sh.sh_flags & SHF_EXECINSTR)) { > - WARN("bad call to %s() for data symbol %s", > - __func__, sym->name); > + WARN("bad call to %s() for %s symbol %s", > + __func__, origin, sym->name); > return NULL; Thanks for the patch. That warning was already phrased pretty awkwardly which was probably part of the confusion. It could be rephrased to make it a little clearer: Something like: .cfi_sites: unexpected reference to non-executable symbol 'execute_location' And ".cfi_sites" is already in 'sec->name', so you wouldn't need to add the new 'origin' arg. -- Josh