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=-15.8 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,MENTIONS_GIT_HOSTING,SPF_HELO_NONE, SPF_PASS 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 6C949C433B4 for ; Fri, 2 Apr 2021 18:25:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1CE5060C3E for ; Fri, 2 Apr 2021 18:25:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235987AbhDBSZr (ORCPT ); Fri, 2 Apr 2021 14:25:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbhDBSZq (ORCPT ); Fri, 2 Apr 2021 14:25:46 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D03E1C0613E6 for ; Fri, 2 Apr 2021 11:25:44 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id f2-20020a17090a4a82b02900c67bf8dc69so4955304pjh.1 for ; Fri, 02 Apr 2021 11:25:44 -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=7WB9dyBxJfyi+dnN/pUTcNGEGmQQ19of2/quWexK5LI=; b=S6NXdtr+LlK6Nx57Jl5hfAvwLV62rZq1q9FrJPkyMVNZcnp6YgfAJ0ljinGEeEojZL 542zCwNZXfoWy1Ucv+WcLme19/ihTv0HTdcMLHfon7tz7nivoz3RFfhLKvd4pdkzVuhR 5HVoI7ahUuhXAv+n/q9uCCpZVw9CCf5emX71w= 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=7WB9dyBxJfyi+dnN/pUTcNGEGmQQ19of2/quWexK5LI=; b=eL5lgrrJsF26pI1FcxitplnCuJlP37knwFwOgRK/rTd1gwT7yiSqUyjwVPUCkj5Ecc 8C2Z0p0ktXJvyHL2gtb3GYXHoM5+3mv0pfIlnaSJNAlUlgMES/FPr2mIf708ROdm6PCW qSaTMlzMWoNkNBq+EHJ8rDI322djU9jL2qQJuotMiUBXlTCqgV6VwWbHFXnc1yYbQ5Aq jtNqByh2aqtVd7MITSI9vv4EJ29lm+H7Vac7ihJtZbJS1m2JOJOjD7VJj8GN3BJQv7I/ 4SDFyT26URQrCUbflcYx9NSHTyay7u+x1Z0WWh0EBr+d2SkMa7GkjHDSzKgKBVuACXRG J7yA== X-Gm-Message-State: AOAM5312XGL+bAIiIQl9iapPks0ar8hxJ5+unZ+56ehbjPLWcpwXLw+F ALNSVmO2kLiiHh4q/qGl5j3aAA== X-Google-Smtp-Source: ABdhPJxFdQIKTxzrvLroVyzxnLHiDY5q50gwTx44nmerTmTqVhmwikVsbTgh8V9WzpbDCaKSwEXltw== X-Received: by 2002:a17:90a:9413:: with SMTP id r19mr14769842pjo.65.1617387944473; Fri, 02 Apr 2021 11:25:44 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id p17sm8464878pjv.49.2021.04.02.11.25.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Apr 2021 11:25:43 -0700 (PDT) Date: Fri, 2 Apr 2021 11:25:42 -0700 From: Kees Cook To: Sedat Dilek Cc: Gabriel Somlo , Nathan Chancellor , "Michael S. Tsirkin" , linux-kernel@vger.kernel.org, Nick Desaulniers , qemu-devel@nongnu.org, Clang-Built-Linux ML , Sami Tolvanen Subject: Re: [PATCH] qemu_fw_cfg: Make fw_cfg_rev_attr a proper kobj_attribute Message-ID: <202104021125.53164550A@keescook> References: <20210211194258.4137998-1-nathan@kernel.org> <161428829728.2305454.15456455443457551559.b4-ty@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.) -Kees > > Feel free to add my: > > Tested-by: Sedat Dilek > > - Sedat - -- 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=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS 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 37ADEC433B4 for ; Fri, 2 Apr 2021 18:27:36 +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 A41CE61163 for ; Fri, 2 Apr 2021 18:27:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A41CE61163 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:54256 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lSOW6-0006Tk-D0 for qemu-devel@archiver.kernel.org; Fri, 02 Apr 2021 14:27:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58938) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lSOUP-0005xk-Fz for qemu-devel@nongnu.org; Fri, 02 Apr 2021 14:25:49 -0400 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]:38735) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lSOUN-0004R3-La for qemu-devel@nongnu.org; Fri, 02 Apr 2021 14:25:49 -0400 Received: by mail-pj1-x102d.google.com with SMTP id k23-20020a17090a5917b02901043e35ad4aso4947624pji.3 for ; Fri, 02 Apr 2021 11:25:45 -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=7WB9dyBxJfyi+dnN/pUTcNGEGmQQ19of2/quWexK5LI=; b=S6NXdtr+LlK6Nx57Jl5hfAvwLV62rZq1q9FrJPkyMVNZcnp6YgfAJ0ljinGEeEojZL 542zCwNZXfoWy1Ucv+WcLme19/ihTv0HTdcMLHfon7tz7nivoz3RFfhLKvd4pdkzVuhR 5HVoI7ahUuhXAv+n/q9uCCpZVw9CCf5emX71w= 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=7WB9dyBxJfyi+dnN/pUTcNGEGmQQ19of2/quWexK5LI=; b=pLjjdCUKwBtgKrESzBgoTh/VeUrQZpNE0jNEQ17yX7GiwTKAnakZnMBuqbTMIGUpKk o9ji6DsB5NKp6KbVNsFYe007rKkBmpZbMWlN1MGKvxFw4GJRmcYrjPL4w682qSs0+MM6 pIJpNN+yqF4SctKeyNrzSEub4S4yXgNyFJ7K1N8Sc2WS3fPURLpU5s9zmQ43zx7a7TFu DOiKfz8VIMJbVz1B7KsCHKlnj+vb9mT2MEFXFTwVpZxqgBIwdW8XnUOfFzrcpcGZRnUT a65SF30y2RyqABy9ixTF9p+SfJJf7x2sofH2H6Q6L9XA8Pjh5wpTyciD50cjC2G0sPrN 6f1g== X-Gm-Message-State: AOAM532H8hBD1IUp91Hmdk5wzvqiPqd4bYxgp3Og+WGk+eZ3BafstFij 3Ae4XPB6n6G4cSouUTeIshfiKA== X-Google-Smtp-Source: ABdhPJxFdQIKTxzrvLroVyzxnLHiDY5q50gwTx44nmerTmTqVhmwikVsbTgh8V9WzpbDCaKSwEXltw== X-Received: by 2002:a17:90a:9413:: with SMTP id r19mr14769842pjo.65.1617387944473; Fri, 02 Apr 2021 11:25:44 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id p17sm8464878pjv.49.2021.04.02.11.25.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Apr 2021 11:25:43 -0700 (PDT) Date: Fri, 2 Apr 2021 11:25:42 -0700 From: Kees Cook To: Sedat Dilek Subject: Re: [PATCH] qemu_fw_cfg: Make fw_cfg_rev_attr a proper kobj_attribute Message-ID: <202104021125.53164550A@keescook> References: <20210211194258.4137998-1-nathan@kernel.org> <161428829728.2305454.15456455443457551559.b4-ty@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=keescook@chromium.org; helo=mail-pj1-x102d.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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: , Cc: "Michael S. Tsirkin" , Gabriel Somlo , Nick Desaulniers , qemu-devel@nongnu.org, linux-kernel@vger.kernel.org, Nathan Chancellor , Clang-Built-Linux ML , Sami Tolvanen Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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.) -Kees > > Feel free to add my: > > Tested-by: Sedat Dilek > > - Sedat - -- Kees Cook