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=-7.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 0E3A6C10DAA for ; Thu, 3 Sep 2020 22:12:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D756620722 for ; Thu, 3 Sep 2020 22:12:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="IGPy3Ev8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728684AbgICWMA (ORCPT ); Thu, 3 Sep 2020 18:12:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727804AbgICWL5 (ORCPT ); Thu, 3 Sep 2020 18:11:57 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C20DC061245 for ; Thu, 3 Sep 2020 15:11:56 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id b124so3424728pfg.13 for ; Thu, 03 Sep 2020 15:11:56 -0700 (PDT) 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=5FkC7ZydcYZ7OvnDcVYU3cxvw/A+RLXuwzidT1u3ktE=; b=IGPy3Ev8EutCuQb4lwsTx1VAvqIeOIRFD7wLuyvXGTSAxwz8hL6v0K8f8IQ9Y+H11S fKbqKBL1KVGfL9CLfKWhp972pCQiDMPENIKcZYhRYuBh/NJ5d1xhg8qEzMWhJmjTO78y hpDI1nGkw9U2lPKfWpYJ5VKAyDFTBSuj0ip0o= 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=5FkC7ZydcYZ7OvnDcVYU3cxvw/A+RLXuwzidT1u3ktE=; b=ddR0s+JxRtMaYIxptpqck3ypkKQh/Vnczx+i4z96uWgHBO5DtwcC2lJZ3eYBgFtZke Hx12qqqP9kdeMgyApk0O1f+Z8547jezohbJ263BqOLTLgfReIJITeqNx2oMTpzwq5u8D dBeGYimqkRvoiUe36wOJrUU7Mb0XGx7mO3qYP9dBxqC9e3QGXRXseySlUEWxI3UC837E +HcE56lVhgq1Mehm0MVMxrPrzH2JvwrzNzh5s71+YdFjSU7R20LLHgLFWge0bKqWukRj bl553xr2tiVINJkkXzl6+hZ6rUpd4nlUaaktLAppugzfdJG83ovNHs2KAHkDInJH+Wtq OppQ== X-Gm-Message-State: AOAM532RFk3GFDd7YOTCayN+LY+Ma/3dRhqnksiEag4XLLtjOjpiGO1N uCsl5G6kj9aeDUtzauf3iN3dcA== X-Google-Smtp-Source: ABdhPJxNUt7QAkJJr6DVIatL2r/ZHjflOqWAAtFiZXIMzyxOBsAVSA+Y4d6vSRQM4txHS5CM9PwpZQ== X-Received: by 2002:a17:902:d702:: with SMTP id w2mr6057532ply.53.1599171116270; Thu, 03 Sep 2020 15:11:56 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id a6sm3721602pgt.70.2020.09.03.15.11.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 15:11:55 -0700 (PDT) Date: Thu, 3 Sep 2020 15:11:54 -0700 From: Kees Cook To: Sami Tolvanen Cc: Masahiro Yamada , Will Deacon , Peter Zijlstra , Steven Rostedt , Greg Kroah-Hartman , "Paul E. McKenney" , Nick Desaulniers , clang-built-linux@googlegroups.com, kernel-hardening@lists.openwall.com, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH v2 10/28] kbuild: lto: fix module versioning Message-ID: <202009031510.32523E45EC@keescook> References: <20200624203200.78870-1-samitolvanen@google.com> <20200903203053.3411268-1-samitolvanen@google.com> <20200903203053.3411268-11-samitolvanen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200903203053.3411268-11-samitolvanen@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 03, 2020 at 01:30:35PM -0700, Sami Tolvanen wrote: > With CONFIG_MODVERSIONS, version information is linked into each > compilation unit that exports symbols. With LTO, we cannot use this > method as all C code is compiled into LLVM bitcode instead. This > change collects symbol versions into .symversions files and merges > them in link-vmlinux.sh where they are all linked into vmlinux.o at > the same time. > > Signed-off-by: Sami Tolvanen The only thought I have here is I wonder if this change could be made universally instead of gating on LTO? (i.e. is it noticeably slower to do it this way under non-LTO?) 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=-7.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 13882C433E2 for ; Thu, 3 Sep 2020 22:13:12 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 C7B7620716 for ; Thu, 3 Sep 2020 22:13:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="dgX/whiO"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="IGPy3Ev8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C7B7620716 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=nAN/y/gnytVrQSNNoWdXDWvqk/wammUo6kXy0edzuCo=; b=dgX/whiO7K6qxn/mLd/PkQK/q U0T+THhU1e5e3CnFdUXXUoatbB0F9pnI6Is23CB9dZcbUtfbqp4LK0/HLfuJAmlLD7e4/F6Bfpqab WBiUNYbD4lEp40aZcF87HXG71aH/7QTwst9TQIw7N4BL/nzTltuGj/XtQuc4IAhT/Wvbw5fiKVkKW sli43i2aIKQFF7cvpbEZwU0dE75G5Sa47NAhAOwx67iA4OUYjEcRz3DfNW06C3phqHrlqDC7yM+/r 4WTkps1mypz5Iq6HrAgC1GXUS5No76QMtcruh6fkEJHagt/GszshibwdJvFojkveRiNeyyG35yLQy uxPGydidQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDxSa-0006Xj-P3; Thu, 03 Sep 2020 22:12:00 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDxSY-0006Wh-81 for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 22:11:59 +0000 Received: by mail-pg1-x544.google.com with SMTP id v15so3216284pgh.6 for ; Thu, 03 Sep 2020 15:11:57 -0700 (PDT) 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=5FkC7ZydcYZ7OvnDcVYU3cxvw/A+RLXuwzidT1u3ktE=; b=IGPy3Ev8EutCuQb4lwsTx1VAvqIeOIRFD7wLuyvXGTSAxwz8hL6v0K8f8IQ9Y+H11S fKbqKBL1KVGfL9CLfKWhp972pCQiDMPENIKcZYhRYuBh/NJ5d1xhg8qEzMWhJmjTO78y hpDI1nGkw9U2lPKfWpYJ5VKAyDFTBSuj0ip0o= 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=5FkC7ZydcYZ7OvnDcVYU3cxvw/A+RLXuwzidT1u3ktE=; b=WZod/Q07XjkzAD4j4uNsnRSJex5i3SyGJOtekGGyICZpfLhC6cHKdEWuBYxK0vqs7n RUjjIrDI+FGauFjpUEcQpg9dXdlHdm6K9YRj8HrwcRVwKOs831OxLYFVqNKC35IzdRo2 /u1xVtQ5BrysNyox21LZs3KKK08hF84OwIg9hmx7mjSpqTabeBBPlBiQLen8+CELeif1 nkM5yhh9FyKkHka9QCITEbRzueour+MUBeFqwYl5r21VUsSMvZWhykTme0qhb/LiFGRL Pn/ZRPOeMqaZEAGG+SxXsqpcU1DbX36zsHN+o64UkEFro7fjImlMon+Y1AR0ANkwQi0e 3x/w== X-Gm-Message-State: AOAM530cP1gdt5mxFcY4hiSkCGS8zx7e95++XJa+TbRIm6RCpPlDN99g 3phr3gzsJ4XuwY/Kv8n2Ws3ShQ== X-Google-Smtp-Source: ABdhPJxNUt7QAkJJr6DVIatL2r/ZHjflOqWAAtFiZXIMzyxOBsAVSA+Y4d6vSRQM4txHS5CM9PwpZQ== X-Received: by 2002:a17:902:d702:: with SMTP id w2mr6057532ply.53.1599171116270; Thu, 03 Sep 2020 15:11:56 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id a6sm3721602pgt.70.2020.09.03.15.11.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 15:11:55 -0700 (PDT) Date: Thu, 3 Sep 2020 15:11:54 -0700 From: Kees Cook To: Sami Tolvanen Subject: Re: [PATCH v2 10/28] kbuild: lto: fix module versioning Message-ID: <202009031510.32523E45EC@keescook> References: <20200624203200.78870-1-samitolvanen@google.com> <20200903203053.3411268-1-samitolvanen@google.com> <20200903203053.3411268-11-samitolvanen@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200903203053.3411268-11-samitolvanen@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200903_181158_310843_D0DC2C04 X-CRM114-Status: GOOD ( 14.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, x86@kernel.org, "Paul E. McKenney" , kernel-hardening@lists.openwall.com, Peter Zijlstra , Greg Kroah-Hartman , Masahiro Yamada , linux-kbuild@vger.kernel.org, Nick Desaulniers , linux-kernel@vger.kernel.org, Steven Rostedt , clang-built-linux@googlegroups.com, linux-pci@vger.kernel.org, Will Deacon , linux-arm-kernel@lists.infradead.org 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, Sep 03, 2020 at 01:30:35PM -0700, Sami Tolvanen wrote: > With CONFIG_MODVERSIONS, version information is linked into each > compilation unit that exports symbols. With LTO, we cannot use this > method as all C code is compiled into LLVM bitcode instead. This > change collects symbol versions into .symversions files and merges > them in link-vmlinux.sh where they are all linked into vmlinux.o at > the same time. > > Signed-off-by: Sami Tolvanen The only thought I have here is I wonder if this change could be made universally instead of gating on LTO? (i.e. is it noticeably slower to do it this way under non-LTO?) 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