From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C302C43332 for ; Fri, 12 Mar 2021 02:46:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 132FF64F95 for ; Fri, 12 Mar 2021 02:46:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231562AbhCLCpe (ORCPT ); Thu, 11 Mar 2021 21:45:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231373AbhCLCpM (ORCPT ); Thu, 11 Mar 2021 21:45:12 -0500 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA6CCC061765 for ; Thu, 11 Mar 2021 18:45:11 -0800 (PST) Received: by mail-pl1-x62c.google.com with SMTP id c16so11241363ply.0 for ; Thu, 11 Mar 2021 18:45:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=RwJ0npvlf94WoHHNghlKh7pfAsSY3kaD5+gAJapol+w=; b=bpZBKNh/QL9GElmYyMVWjg0TXLHOvRLf/AJusUpMp5M9GhAoX1vyXiQO5qjooDTLBU JzoyxgAy+jtXqTW2nhjU+NFbBjWEh9Cnaiik7yl7LEJVvRol9EJH9gFiWziYFuLK0mlG LfGHNNjlBiC2I2x4tgijzQUT7YRqmnmrZhpM4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=RwJ0npvlf94WoHHNghlKh7pfAsSY3kaD5+gAJapol+w=; b=Kh3YHu/eHTz8zMQeWLLRoYtRyOHa+d6Vx8SXaGw+muMA+9dwQ4TltuEsMEo3ezUmV+ ty7JSOEBkgJe0bzY4o51QuHsaWfztG+my6VxZJ7MrZZTxzQ7XdHU2l6+INpIdd1z1Y9o yyOcnc7TemuS9GC1FxP/gHpt1QFueMWe+COosGB5WlnjM2fk6KGLgBoWJ+SYf3EnplGF FfSziPP8D7WfiTjKawdQqLJaiLy7KCARgZPH4xwesWkT6IiXOygU22Si/0W+/WWcuwRh tdyd6pu6j4OjV2AzgFiZRJogGHe4yvQQ0JNeSRuQNx95rgpGMeZltYHnXhCphU21PMIN SwRQ== X-Gm-Message-State: AOAM530VSwrcZgmAGZht1kU77tta+QV5iFkG4eAnmRH69EOx2j7GZoxc ctU1a2QQCu1n0qDl+2C4QY7naw== X-Google-Smtp-Source: ABdhPJx0aXaKeloHsr9QGNEEDau0lh32ZHQZJQ1m7oA0GayR5TMfTM/IufYD/dXI5ahtsSEzPZ6Xow== X-Received: by 2002:a17:902:6b43:b029:e6:3d73:e9fb with SMTP id g3-20020a1709026b43b02900e63d73e9fbmr11384932plt.37.1615517111244; Thu, 11 Mar 2021 18:45:11 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id h5sm3498426pgv.87.2021.03.11.18.45.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 18:45:10 -0800 (PST) Date: Thu, 11 Mar 2021 18:45:09 -0800 From: Kees Cook To: Sami Tolvanen Cc: Nathan Chancellor , Nick Desaulniers , Masahiro Yamada , Will Deacon , Jessica Yu , Arnd Bergmann , Tejun Heo , bpf@vger.kernel.org, linux-hardening@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 07/17] kallsyms: cfi: strip hashes from static functions Message-ID: <202103111843.008B935F8@keescook> References: <20210312004919.669614-1-samitolvanen@google.com> <20210312004919.669614-8-samitolvanen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210312004919.669614-8-samitolvanen@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 11, 2021 at 04:49:09PM -0800, Sami Tolvanen wrote: > With CONFIG_CFI_CLANG and ThinLTO, Clang appends a hash to the names > of all static functions not marked __used. This can break userspace > tools that don't expect the function name to change, so strip out the > hash from the output. > > Suggested-by: Jack Pham > Signed-off-by: Sami Tolvanen (Is it possible we could end up with symbol name collisions? ... though I guess we would have had collisions before?) Reviewed-by: Kees Cook -- Kees Cook From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED7D2C433DB for ; Fri, 12 Mar 2021 02:47:04 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 86F6064F87 for ; Fri, 12 Mar 2021 02:47:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 86F6064F87 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0oZG4EYmjVYDf5j07Z7THc0ihQ2bKKd/727iniaIIqs=; b=l4ZaKhcsJDBMlvJz1H3S+XTMi wwr8ZMMIC7LVN/RDoZufolbimSDTCHbUQQGALGRlKde7VtHqlsNSD+KyhAFQXm+JkIRSekk0oSXAD ZMlGxVWW5pTwagTeKKt1dipExP1gWoFvTuziBXqVfl9yAyWDAQhKtg8aEI/by9EH/o0VgzFCNBH2f 5DcqcmBT3VmCNbO7Gzg1Jzad7vTUpS2Ik7wyPkaZq3DJ4KybqromlQR+4//aMXd7zIUKP/D+hrwJ9 CfCeJ+XanTwhmdZsBxtQLgt6wy7idZJpfYkPtgMkgRkg2pURMOnpY3Ul8c3WK5vzK5V4VL3LrjsSv aV0mmHJ+A==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lKXno-00AV4L-04; Fri, 12 Mar 2021 02:45:24 +0000 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lKXne-00AV2g-TD for linux-arm-kernel@lists.infradead.org; Fri, 12 Mar 2021 02:45:18 +0000 Received: by mail-pj1-x102d.google.com with SMTP id lr1-20020a17090b4b81b02900ea0a3f38c1so2573993pjb.0 for ; Thu, 11 Mar 2021 18:45:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=RwJ0npvlf94WoHHNghlKh7pfAsSY3kaD5+gAJapol+w=; b=bpZBKNh/QL9GElmYyMVWjg0TXLHOvRLf/AJusUpMp5M9GhAoX1vyXiQO5qjooDTLBU JzoyxgAy+jtXqTW2nhjU+NFbBjWEh9Cnaiik7yl7LEJVvRol9EJH9gFiWziYFuLK0mlG LfGHNNjlBiC2I2x4tgijzQUT7YRqmnmrZhpM4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=RwJ0npvlf94WoHHNghlKh7pfAsSY3kaD5+gAJapol+w=; b=cp+4FFjSrevv0JhEXa/s/skXx4GBO0cyJ88DCnobdAV52tVS3AmTfzszSspzOigF/c MlOGeBStqIB7RF8MrbXlevIbX8yAL94Pf82+tY1LHpKTtBmAZ0aCLJjc4Xa8jFWTm4kk pcmVwmwwNWQzYxeohpxUuMgceve10HvS1R11dVLdETayXZ/AoKMc2CMDrqWOibuQYKr8 /w0ZT6xbzh4PMiEK6IpCcUCITQ/5yuNLAUXD9pmyL3tf/eMMCH7U981e1yGv1osl2m1U Pi5ijaZLNDEaFFC/WLShY7nibfU7ARLAiWJZ9Ov3CxlY6A/G/ok5vqKYFKwIoqWhAEMB d89A== X-Gm-Message-State: AOAM533CvJi3AIZJGF6296In1DjgjeOu86Xibgrdwvx+rRjHoELSNaot q1RkTnCHxMwOUlt3ZCjce7H7rw== X-Google-Smtp-Source: ABdhPJx0aXaKeloHsr9QGNEEDau0lh32ZHQZJQ1m7oA0GayR5TMfTM/IufYD/dXI5ahtsSEzPZ6Xow== X-Received: by 2002:a17:902:6b43:b029:e6:3d73:e9fb with SMTP id g3-20020a1709026b43b02900e63d73e9fbmr11384932plt.37.1615517111244; Thu, 11 Mar 2021 18:45:11 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id h5sm3498426pgv.87.2021.03.11.18.45.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 18:45:10 -0800 (PST) Date: Thu, 11 Mar 2021 18:45:09 -0800 From: Kees Cook To: Sami Tolvanen Cc: Nathan Chancellor , Nick Desaulniers , Masahiro Yamada , Will Deacon , Jessica Yu , Arnd Bergmann , Tejun Heo , bpf@vger.kernel.org, linux-hardening@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 07/17] kallsyms: cfi: strip hashes from static functions Message-ID: <202103111843.008B935F8@keescook> References: <20210312004919.669614-1-samitolvanen@google.com> <20210312004919.669614-8-samitolvanen@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210312004919.669614-8-samitolvanen@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210312_024517_176205_F3062658 X-CRM114-Status: GOOD ( 11.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Mar 11, 2021 at 04:49:09PM -0800, Sami Tolvanen wrote: > With CONFIG_CFI_CLANG and ThinLTO, Clang appends a hash to the names > of all static functions not marked __used. This can break userspace > tools that don't expect the function name to change, so strip out the > hash from the output. > > Suggested-by: Jack Pham > Signed-off-by: Sami Tolvanen (Is it possible we could end up with symbol name collisions? ... though I guess we would have had collisions before?) Reviewed-by: Kees Cook -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel