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=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 1F6FCC433E0 for ; Thu, 18 Mar 2021 21:40:52 +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 AFE1464F33 for ; Thu, 18 Mar 2021 21:40:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AFE1464F33 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com 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:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=cj+F1xLVTLksOC/qjevkyshEOhKiaKvL5mGKi9txdXQ=; b=aLopSX8AAWLQ8xkn5dK6vMVIW B09VuVbOCgsWnmLit/WoeWIwiQsn67qhCNEuAOvPbkkJNo5cdghsVHTY+AQZGEFWSL1OqH/IXBErE 8/ZvxDT1utWRUktwNISvcssNO/svKsRdFg4NITFEo+9ISSE++TWyP8dSpHZL5YFpH1glHlUBenHKP 2WLfLEpaJvGZU4IDH5ara2ft5Xiwqym4trAfretqfgsTz/i2UxSuloHUx0SNqhHDvwDElYQeHrYkt nZxOQ/cvWf4qzIe3kTw1TD4J/RIvvDvyst5d9Cx99iqzyNwfVLbhPv08VWfoy5OgOnXtY2lZFk1VM 0jnD0qOEw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lN0Lu-0063U3-Mi; Thu, 18 Mar 2021 21:38:52 +0000 Received: from mail-vs1-xe2d.google.com ([2607:f8b0:4864:20::e2d]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lN0LZ-0063T4-63 for linux-arm-kernel@lists.infradead.org; Thu, 18 Mar 2021 21:38:31 +0000 Received: by mail-vs1-xe2d.google.com with SMTP id v2so2371982vsq.11 for ; Thu, 18 Mar 2021 14:38:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vLPqaFCjOxJqP96ilPAU1cPfZQuKxpOHXRuDS0s7Vr4=; b=qKVpWtCjskEKfxSobzVob96NxKhzoHpA0zkVpey6v9nz5hqX4fwpWRs2r3Xv0LtQVY G16K6pLlLiiOgiA9WlvBYuNv+dkBxVQoBMTZmRC3drafHcUHKnQM/tG/M+cxNlkBKFlD 6s0+yKEf1+/y0f7FoLfouj1leYGLXXX0BHvTCWQ+suw1xpi/HPjaWWJGI7rE5Zq4hjN+ KeG6ltSdPXps4+kFCWvGrU0ia0VmTHM2GBqcg/2BbR/sCeCZJbCtvjlsmF4re7pImMHk IhFvMOnUBJEqxCQDOIJTiaQI5tXqy8l13Wdqav4qDmK3cuJjAHbGFKOiSQWrw4vDipzM ux1A== 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:from:date :message-id:subject:to:cc; bh=vLPqaFCjOxJqP96ilPAU1cPfZQuKxpOHXRuDS0s7Vr4=; b=gnLqvu/B+fsCzMoPic07xORmDHjF7Ht42FslRzNqFWGhB7te0REag0Vi522aFKpCId 1n+HPhTgLwXwkdX6p8P9laFXtJPl1I4ToBoXzPZfanh3DZBj3Fzztru8v8+YUCpgiGIS cEJa+Yi6qNtpPiDXsRJIn89gif8YNNmR89bo5TQpMe0dalHoYX+5DRorjSwWMvZTBw4k cxFD9D6EUXJHvtb7VRjI25LIyrRmMTZ947ZnwIAWJhbZ+dzlJNM0sGwaCvoWFkbu6zWK 5gn5rJV7iYtFP0wSPpceuFtPBxMm9a7HK1xVzU6z4Lb5Ca9n594XVNQzTPq3CRniW8Og SW1g== X-Gm-Message-State: AOAM532lwYp1kMVR1nFi4bonj939pUpd9m6lpd10Gl0ONPW1PrirIQ2Q fSXD32IvfqcJ1XyuY6LzRDA6kjP5HskNPflqwU5w9g== X-Google-Smtp-Source: ABdhPJyaMaWSU8mQS4gTjUoMCHt/hL7J7EWOKPoWt/RxfzbbDBNbfggOD5G6oZscrzSei7ViS8Oslpe0+7Gv7JZE5Pk= X-Received: by 2002:a67:2803:: with SMTP id o3mr1141643vso.36.1616103503542; Thu, 18 Mar 2021 14:38:23 -0700 (PDT) MIME-Version: 1.0 References: <20210318171111.706303-1-samitolvanen@google.com> <20210318171111.706303-6-samitolvanen@google.com> In-Reply-To: From: Sami Tolvanen Date: Thu, 18 Mar 2021 14:38:12 -0700 Message-ID: Subject: Re: [PATCH v2 05/17] workqueue: use WARN_ON_FUNCTION_MISMATCH To: Nick Desaulniers Cc: Kees Cook , Nathan Chancellor , Masahiro Yamada , Will Deacon , Jessica Yu , Arnd Bergmann , Tejun Heo , "Paul E. McKenney" , Christoph Hellwig , bpf , linux-hardening@vger.kernel.org, linux-arch , Linux ARM , Linux Kbuild mailing list , PCI , LKML X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210318_213829_823250_979EADC8 X-CRM114-Status: GOOD ( 20.50 ) 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 18, 2021 at 11:50 AM Nick Desaulniers wrote: > > On Thu, Mar 18, 2021 at 10:11 AM Sami Tolvanen wrote: > > > > With CONFIG_CFI_CLANG, a callback function passed to > > __queue_delayed_work from a module points to a jump table entry > > defined in the module instead of the one used in the core kernel, > > which breaks function address equality in this check: > > > > WARN_ON_ONCE(timer->function != delayed_work_timer_fn); > > > > Use WARN_ON_FUNCTION_MISMATCH() instead to disable the warning > > when CFI and modules are both enabled. > > Does __cficanonical help with such comparisons? Or would that be a > very invasive change, if the concern was to try to keep these checks > in place for CONFIG_CFI_CLANG? The last time I checked, Clang ignored the __cficanonical attribute in header files, which means it would still generate a local jump table entry in each module for such functions, and the comparison here would fail. We could avoid the issue by using __cficanonical for the callback function *and* using __va_function() when we take the function address in modules, but that feels way too invasive for this particular use case. Sami _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel