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=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,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 5DB6EC433E0 for ; Fri, 12 Mar 2021 06:14:55 +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 E8BB764F7A for ; Fri, 12 Mar 2021 06:14:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E8BB764F7A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.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=OrlJi9u7g3YYMbkeC2H1/RZ5WJXcyX4jtlCWarXWtRk=; b=iKslBueRjUsNuWzbIVTRjqwnh dw2TdcTGtz3j/NGv50FhbTAkig3Ypi6kKfrnbHj4KcgprDtjaHzG0gnudEZQT99YSiGhRV/gs+mBc C1u+xmZXrA8M9wKsuRy3Wg22Kjdqwu4tITADXq/9IV5GeJ/JxmTuBMdJ9tL4tHIMi0YKNIwGrxqQW 68f0gJneKKuHryM7QW1fNNipMDcJ2XrUxSm7KLkjoaVs1M6/hx2pk03E4xxihLBm7sn4jZ5VpHVg1 3VZUSWOJ27fL+HvtTU9dY9OftNwo3999YM5pTo9zzvol3aYHjrWhqBHDhHofvXLWvb/AKUtfkM0Sk Q3Jpe98SA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lKb2t-00AgUY-1I; Fri, 12 Mar 2021 06:13:11 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lKb2p-00AgUS-T2 for linux-arm-kernel@desiato.infradead.org; Fri, 12 Mar 2021 06:13:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=tuWZsMs6exFN5R6PkELmsSGZweW8Hs198xcKIgwMDDA=; b=lKgmtNx16rBafs3JaCtnDBNN9n O6UTTPm8K5kiDBxz+uzhjX6F1WZt2hyW3UAnwhOvUrqVrnmF7hF+i8TPsB5DhA0o4luVKIdfpVhFR bbuqXexPcd8BzIUJlU/DvHgi1/NLRyzh3xCmi2lbbwmHQoggTDF9+ywnL+oW68Jj/SyoI0hx/ETdA VsnXK3dD9LZz1qYVvd8y/ukyPeeWJmLayh4EmttPXTgLOO9OHgThs/BEdmSq4lRPJ687QsTfelOfE Lfw7lu0Nf96lvw/b0gosuhPWwhaeWc6mb4nFT/70JDWVr7DnqlC2w9+Bs4SHVw0U7v9agtc+l0/gi +R2nkieQ==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lKb2m-009kSg-Af; Fri, 12 Mar 2021 06:13:05 +0000 Date: Fri, 12 Mar 2021 06:13:04 +0000 From: Christoph Hellwig To: Sami Tolvanen Cc: Kees Cook , 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 06/17] kthread: cfi: disable callback pointer check with modules Message-ID: <20210312061304.GA2321497@infradead.org> References: <20210312004919.669614-1-samitolvanen@google.com> <20210312004919.669614-7-samitolvanen@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210312004919.669614-7-samitolvanen@google.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html 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:08PM -0800, Sami Tolvanen wrote: > With CONFIG_CFI_CLANG, a callback function passed to > __kthread_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 != kthread_delayed_work_timer_fn); > > Disable the warning when CFI and modules are enabled. > > Signed-off-by: Sami Tolvanen > --- > kernel/kthread.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/kernel/kthread.c b/kernel/kthread.c > index 1578973c5740..af5fee350586 100644 > --- a/kernel/kthread.c > +++ b/kernel/kthread.c > @@ -963,7 +963,13 @@ static void __kthread_queue_delayed_work(struct kthread_worker *worker, > struct timer_list *timer = &dwork->timer; > struct kthread_work *work = &dwork->work; > > - WARN_ON_ONCE(timer->function != kthread_delayed_work_timer_fn); > + /* > + * With CFI, timer->function can point to a jump table entry in a module, you keep spewing this comment line that has exactly 81 characters and thus badly messes up read it with a normal termina everywhere. Maybe instead of fixing that in ever duplication hide the whole check in a well documented helper (which would have to be a macro due to the typing involved). _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel