Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1010262pxf; Thu, 25 Mar 2021 21:38:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwr9pUf/XaaUaJfGZc8yqbR8jIb6WB6s9Op1h1wag1ctwbjVmKo9o/Zx4t++OMQwVdgzDJ X-Received: by 2002:a05:6402:3122:: with SMTP id dd2mr12520224edb.253.1616733521928; Thu, 25 Mar 2021 21:38:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616733521; cv=none; d=google.com; s=arc-20160816; b=Q+pHPRP1nvbgIzFadruFX2Qb6TYz6MyMdEn5Snl8ghB9euhW//F1zk5S57D+elfJjH 6UfG3d0UoM6T3389lF/YSYTsFS8odW/dtPTSIwkFWWiJEO6ZuYVG8RrDi7T2MyJWYYPG 3DD6A/XVHH98zuern2WMtgfWwL3IClQsTlgTNrpreOoNTAm7oJVdP6BE7WZ+qe8EPAWV UavSwhIZUdwIq6GbK2JQdchQ6DZbXDFPUKAX8h/u8LpdoEOhcOre1YgzVK8McLp+bhpA 4jPF1z4jAl2o5dtqw04ie+m9WwZNgErrnoFYeVIF0YsbWD7TxpToaQtqK3MK/ecNSwtk JENQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ZznyDRg62Aq1s1+p2944fwJCGEKWMFo0KzijBRVLdmY=; b=vLpnjb7WjLXNEFVQOOGwRI44JVILtYe6C13i6jcR1k7eqRSA6+BCjs4PNseJoCuVpG jZqjTh9PhtzlJGGOsvoYhaaQm14gfWsySO9JPyfMlDbKW9VLYZzz8mJRo1j3laTFSE44 IESwt1VnX0m+KjWHB1/kuwuOwsbI0JJhhPAtpWWg+lKPubPxiDx0OcgEDwzBeWCMQkec nkCbwqJygVt2KYYv0cLev2o5CcjgO52Y+jC9B1ldvzbBV31i3y9nF6XoUmioz+S2QmLI Zqd+hbNXGX8GCxoWnnKNTrr9hN0pUx7CEDzQYHe9T/XWSup5grr3z//a9qbS0DO5T+Nq sdQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=TIB4PsMH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u6si5653216ejx.73.2021.03.25.21.38.19; Thu, 25 Mar 2021 21:38:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=TIB4PsMH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231370AbhCZEfP (ORCPT + 99 others); Fri, 26 Mar 2021 00:35:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231340AbhCZEe4 (ORCPT ); Fri, 26 Mar 2021 00:34:56 -0400 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCF6AC0613D7 for ; Thu, 25 Mar 2021 21:34:55 -0700 (PDT) Received: by mail-pg1-x532.google.com with SMTP id v3so3794225pgq.2 for ; Thu, 25 Mar 2021 21:34:55 -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=ZznyDRg62Aq1s1+p2944fwJCGEKWMFo0KzijBRVLdmY=; b=TIB4PsMHJfphVL92/msg3G5qMO4sc9Q0j+qrJPLXwTDkmFfcf0Ausc1NmOjXDUFjD1 GDkWCYMA3bUeziVVqzGGizG/fAmUwj8oXAFn38jaiwedU+5KjkHu1IQGatlAG01m56gy zq5vsbOryhA4183WK8CwjCtKavIwW9tgiaU9w= 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=ZznyDRg62Aq1s1+p2944fwJCGEKWMFo0KzijBRVLdmY=; b=WQ1nNLFBvmcGeo/8UgnGyu33I6NxBh1TH/aBfYD6XWxLI4Hk4wvxY6vGKPhetcPw43 slU3RsDhSTA/oCPE2zgjZiHJAN6+2MpKHoGx9ap1C8r8slzQvo8r+HdtV/Xs/o6tNeg9 HIV8zxdC21nG7AVOKA5QpAAL9LaJVHxuPVbmBf82vYu3IvjHYsboxCpq2YJCwnbau5ic lbRHgcVbCLq65QVGmvJgU03MlLFElF7h/uj9UJfTwsfShVwBNQzOKiZg5UGgW4MbUbBf 2t212b2RSxvVGo28t3vosW2pVnafoiJToq7x1qRVkjhpXDeBMVx4KtdeL8Mq7KZZFRg0 +KcA== X-Gm-Message-State: AOAM533sn9hPtskABySQKkdZS01fsMw15atEcSqKJ97ETJDcvxenIfgW trmE7lOdy6jtXT1wTr9EH9+sUw== X-Received: by 2002:aa7:8e8f:0:b029:1f1:5a1a:7f82 with SMTP id a15-20020aa78e8f0000b02901f15a1a7f82mr11057824pfr.52.1616733295456; Thu, 25 Mar 2021 21:34:55 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id w191sm8543354pfd.25.2021.03.25.21.34.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Mar 2021 21:34:54 -0700 (PDT) Date: Thu, 25 Mar 2021 21:34:54 -0700 From: Kees Cook To: Sami Tolvanen Cc: Nathan Chancellor , Nick Desaulniers , Masahiro Yamada , Will Deacon , Jessica Yu , Arnd Bergmann , Tejun Heo , "Paul E. McKenney" , Christoph Hellwig , Peter Zijlstra , 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 v3 05/17] workqueue: use WARN_ON_FUNCTION_MISMATCH Message-ID: <202103252134.03274C44@keescook> References: <20210323203946.2159693-1-samitolvanen@google.com> <20210323203946.2159693-6-samitolvanen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210323203946.2159693-6-samitolvanen@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 23, 2021 at 01:39:34PM -0700, 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. > > Signed-off-by: Sami Tolvanen Reviewed-by: Kees Cook -- Kees Cook