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.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS 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 44754C433B4 for ; Fri, 2 Apr 2021 18:45:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0C442610F7 for ; Fri, 2 Apr 2021 18:45:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234652AbhDBSp2 (ORCPT ); Fri, 2 Apr 2021 14:45:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbhDBSp1 (ORCPT ); Fri, 2 Apr 2021 14:45:27 -0400 Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06F01C0613E6 for ; Fri, 2 Apr 2021 11:45:26 -0700 (PDT) Received: by mail-io1-xd2e.google.com with SMTP id r193so3235764ior.9 for ; Fri, 02 Apr 2021 11:45:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=/OThl2TJ86i+d/Z9onNMKzzml/86evlKk1D8sXUWm3s=; b=spoXp4ymwf+FzwwvTbLnfHRGKw2cJp5whg010ZpGpMj7Je/U9GpUX6h6Shj6vEnj2V 2pp5bM13UMj8HBbM4e2Vp0mulbICA5btgWbxg5n8kuhbvRBwdQ2Sqxcr4EXaXFrFyGCy hzWx5OJj9NkNVwIpEQSB2Nmw9EqP5y6PpWTSmkRP0+RAxS5p4DSEeMb/nOfHbuZjXzSn aFIusYmUpIEbZM8XuaIqO1SXNamHYjSKcmwZSKPDq9TbxZs8POr5ji4EDRBgo9lLzglR q1FL2F4XNE+T4ISBWzkZfA8NAk3Tcm7mFWPxpn/Y6/+fa9GcFZBsUPajvlorufdoNmpS VoNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=/OThl2TJ86i+d/Z9onNMKzzml/86evlKk1D8sXUWm3s=; b=EY1lUybvTvuzo/9oZk7X/y9p4AY+BeECVMD1/adEGPns1wy/NOjJP9yz20I8qIZmc+ 8OL1OrAPRbvnFR5Uv/Q6d9120WKyxFn1+dlZlZq+dIYfdzqPfFbOV5FG9b2dLzADZLfO 7neyOgg5T9V7T0kAhPFNkMvyEQ6731qJDEjRlTbTRGuX+JVVOFWr6KLQxo41NKUMfnkC UKW7sIJBIMU2iflxSyfPQOLfKsvwzUIRuVZDxt0NAuZYM6vJUA7M9Zw4waKvoCC4scXS M8e3LbqMb93CuFSPgLaTOXKDSFrAGbXk6ECgOaq278nBN3doySqCE+lFe9rp+JH1CBOi SNNw== X-Gm-Message-State: AOAM533RlpuLv0RqEvbzteoxSo17lWB/dlFKHG4viraWEN53hu62wDnh tx0QY5FkEY+2HA2/Njc9RqIAmgPX4Z22TA5Ox2A= X-Google-Smtp-Source: ABdhPJwIz5lMeJXF/ig31xaHINMB9NbZhAF9rqQ90Plamzp40mgR8F+megcIBShLyOw7K3egXeMkAPSODarClDsRkNY= X-Received: by 2002:a5d:9d13:: with SMTP id j19mr12186378ioj.110.1617389125411; Fri, 02 Apr 2021 11:45:25 -0700 (PDT) MIME-Version: 1.0 References: <20210211194258.4137998-1-nathan@kernel.org> <161428829728.2305454.15456455443457551559.b4-ty@chromium.org> <202104021125.53164550A@keescook> <20210402183110.zmnuoc74mzil3tml@archlinux-ax161> In-Reply-To: <20210402183110.zmnuoc74mzil3tml@archlinux-ax161> Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Fri, 2 Apr 2021 20:44:49 +0200 Message-ID: Subject: Re: [PATCH] qemu_fw_cfg: Make fw_cfg_rev_attr a proper kobj_attribute To: Nathan Chancellor Cc: Kees Cook , Gabriel Somlo , "Michael S. Tsirkin" , linux-kernel@vger.kernel.org, Nick Desaulniers , qemu-devel@nongnu.org, Clang-Built-Linux ML , Sami Tolvanen Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 2, 2021 at 8:31 PM Nathan Chancellor wrote: > > On Fri, Apr 02, 2021 at 11:25:42AM -0700, Kees Cook wrote: > > On Fri, Apr 02, 2021 at 08:42:07AM +0200, Sedat Dilek wrote: > > > On Thu, Feb 25, 2021 at 10:25 PM Kees Cook wrote: > > > > > > > > On Thu, 11 Feb 2021 12:42:58 -0700, Nathan Chancellor wrote: > > > > > fw_cfg_showrev() is called by an indirect call in kobj_attr_show(), > > > > > which violates clang's CFI checking because fw_cfg_showrev()'s second > > > > > parameter is 'struct attribute', whereas the ->show() member of 'struct > > > > > kobj_structure' expects the second parameter to be of type 'struct > > > > > kobj_attribute'. > > > > > > > > > > $ cat /sys/firmware/qemu_fw_cfg/rev > > > > > 3 > > > > > > > > > > [...] > > > > > > > > Applied to kspp/cfi/cleanups, thanks! > > > > > > > > [1/1] qemu_fw_cfg: Make fw_cfg_rev_attr a proper kobj_attribute > > > > https://git.kernel.org/kees/c/f5c4679d6c49 > > > > > > > > > > I have queued this up in my custom patchset > > > (for-5.12/kspp-cfi-cleanups-20210225). > > > > > > What is the plan to get this upstream? > > > > I haven't sent it to Linus yet -- I was expecting to batch more of these > > and send them for v5.13. (But if the kvm folks snag it, that's good > > too.) > > I am going to be putting the CFI series through its paces on both arm64 > and x86_64 over the next week or so on several different machines (in > fact, I am writing up a report right now) so I will probably have some > more of these as I find them. > This was just a friendly ping. Sami has sent some patches which I reported in the early stage of clang-cfi (x86-64) through subtree maintainers. It's up to you Nathan or kvm folks. Upstreamed patches means to me a RDC-ed custom patchset. - Sedat - 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=-5.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS 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 EAA08C433ED for ; Fri, 2 Apr 2021 18:48:45 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 9BB77610C9 for ; Fri, 2 Apr 2021 18:48:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9BB77610C9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:40764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lSOqa-0005dz-Bp for qemu-devel@archiver.kernel.org; Fri, 02 Apr 2021 14:48:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34764) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSOnX-0003qa-Ge for qemu-devel@nongnu.org; Fri, 02 Apr 2021 14:45:35 -0400 Received: from mail-io1-xd2d.google.com ([2607:f8b0:4864:20::d2d]:36652) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lSOnQ-0008AY-Vr for qemu-devel@nongnu.org; Fri, 02 Apr 2021 14:45:35 -0400 Received: by mail-io1-xd2d.google.com with SMTP id f19so6186615ion.3 for ; Fri, 02 Apr 2021 11:45:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=/OThl2TJ86i+d/Z9onNMKzzml/86evlKk1D8sXUWm3s=; b=spoXp4ymwf+FzwwvTbLnfHRGKw2cJp5whg010ZpGpMj7Je/U9GpUX6h6Shj6vEnj2V 2pp5bM13UMj8HBbM4e2Vp0mulbICA5btgWbxg5n8kuhbvRBwdQ2Sqxcr4EXaXFrFyGCy hzWx5OJj9NkNVwIpEQSB2Nmw9EqP5y6PpWTSmkRP0+RAxS5p4DSEeMb/nOfHbuZjXzSn aFIusYmUpIEbZM8XuaIqO1SXNamHYjSKcmwZSKPDq9TbxZs8POr5ji4EDRBgo9lLzglR q1FL2F4XNE+T4ISBWzkZfA8NAk3Tcm7mFWPxpn/Y6/+fa9GcFZBsUPajvlorufdoNmpS VoNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=/OThl2TJ86i+d/Z9onNMKzzml/86evlKk1D8sXUWm3s=; b=i923GyueEPBmOTRt5MRPA/FyBBAR3eXePrYTNtAGuPCOHMktO2mIvjZbUkE8upJPm2 GHjB2dbn13J8yfy+J1im2+uFqQ01VbmiE99uiaN78EuQP57hm5Byta8iXsvX/NGjRpeF Ol1SJXbaoyK4FZ7s2iJ8BbhpxNz21d46JHDspTU0HilqX6ZRdOp24Y4uw/km5hv1mdPQ O91Z2oiyW+H9FCz6LSi6UoOR8Z3UKa0AEkOcLsgRRPZ1a7I8f/PXXuSkSkrzzbkgb3ep 7+G8TkNTTm8XLDhaeX5Zfs4greUHSlVM5Yeu9vOPslPIBodi6TvFkk9O6+t2ifrqY/Nq JCvA== X-Gm-Message-State: AOAM531WrnLnaWrJ7B1yeXPOW61+hwX6bZDGWyWgQH5LHoZP4rKJKzx3 s7MOS6+n2KsLAVNw53Mpu8JZKHx5xkucTOLRBT0= X-Google-Smtp-Source: ABdhPJwIz5lMeJXF/ig31xaHINMB9NbZhAF9rqQ90Plamzp40mgR8F+megcIBShLyOw7K3egXeMkAPSODarClDsRkNY= X-Received: by 2002:a5d:9d13:: with SMTP id j19mr12186378ioj.110.1617389125411; Fri, 02 Apr 2021 11:45:25 -0700 (PDT) MIME-Version: 1.0 References: <20210211194258.4137998-1-nathan@kernel.org> <161428829728.2305454.15456455443457551559.b4-ty@chromium.org> <202104021125.53164550A@keescook> <20210402183110.zmnuoc74mzil3tml@archlinux-ax161> In-Reply-To: <20210402183110.zmnuoc74mzil3tml@archlinux-ax161> From: Sedat Dilek Date: Fri, 2 Apr 2021 20:44:49 +0200 Message-ID: Subject: Re: [PATCH] qemu_fw_cfg: Make fw_cfg_rev_attr a proper kobj_attribute To: Nathan Chancellor Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::d2d; envelope-from=sedat.dilek@gmail.com; helo=mail-io1-xd2d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sedat.dilek@gmail.com Cc: Kees Cook , "Michael S. Tsirkin" , Gabriel Somlo , Nick Desaulniers , qemu-devel@nongnu.org, linux-kernel@vger.kernel.org, Clang-Built-Linux ML , Sami Tolvanen Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Fri, Apr 2, 2021 at 8:31 PM Nathan Chancellor wrote: > > On Fri, Apr 02, 2021 at 11:25:42AM -0700, Kees Cook wrote: > > On Fri, Apr 02, 2021 at 08:42:07AM +0200, Sedat Dilek wrote: > > > On Thu, Feb 25, 2021 at 10:25 PM Kees Cook wrote: > > > > > > > > On Thu, 11 Feb 2021 12:42:58 -0700, Nathan Chancellor wrote: > > > > > fw_cfg_showrev() is called by an indirect call in kobj_attr_show(), > > > > > which violates clang's CFI checking because fw_cfg_showrev()'s second > > > > > parameter is 'struct attribute', whereas the ->show() member of 'struct > > > > > kobj_structure' expects the second parameter to be of type 'struct > > > > > kobj_attribute'. > > > > > > > > > > $ cat /sys/firmware/qemu_fw_cfg/rev > > > > > 3 > > > > > > > > > > [...] > > > > > > > > Applied to kspp/cfi/cleanups, thanks! > > > > > > > > [1/1] qemu_fw_cfg: Make fw_cfg_rev_attr a proper kobj_attribute > > > > https://git.kernel.org/kees/c/f5c4679d6c49 > > > > > > > > > > I have queued this up in my custom patchset > > > (for-5.12/kspp-cfi-cleanups-20210225). > > > > > > What is the plan to get this upstream? > > > > I haven't sent it to Linus yet -- I was expecting to batch more of these > > and send them for v5.13. (But if the kvm folks snag it, that's good > > too.) > > I am going to be putting the CFI series through its paces on both arm64 > and x86_64 over the next week or so on several different machines (in > fact, I am writing up a report right now) so I will probably have some > more of these as I find them. > This was just a friendly ping. Sami has sent some patches which I reported in the early stage of clang-cfi (x86-64) through subtree maintainers. It's up to you Nathan or kvm folks. Upstreamed patches means to me a RDC-ed custom patchset. - Sedat -