Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp261057pxb; Wed, 20 Apr 2022 22:03:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZ3TvI8cxtKP498Rrpzb5IMieleKAdd9QWyv/Jwk8w7ZWoFMIKfs1RRzDQD5A0X7uXOdGk X-Received: by 2002:a17:907:3e16:b0:6df:b4f0:5cc2 with SMTP id hp22-20020a1709073e1600b006dfb4f05cc2mr21577835ejc.285.1650517396252; Wed, 20 Apr 2022 22:03:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650517396; cv=none; d=google.com; s=arc-20160816; b=hGOHsqjIu8I79htnteP+KAHVhp+4IB56tpwD6uUhlqwC86bFiqUMn3qOHQDxgZPs+P TNKSt1bhdVscjUYzI7I8xAzUnrievPuhCI96y1NUw5DN4KXv7/gmy2m0z13RLP9Hqim3 bNi4n5I1mniNm8CA79TJLsF3K4JqqqG/VgIacrXPDRjrkqKUgs5NBLk0uFLhAdy28k0C UKUfLxsDSBwCyyPGCUtwrhD+7zfbYYEA/i147W99zyTbilE5AvVLGgmq03dolkjilauo qZOaUG3Kd1OA8sSb1Uwd5hjTBPVCokHYymEOTjF14qoApTVo6NQQbqcCFDbqRj+8l543 V/pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=9yM/o5s9LEgwsPr/6QFRtiOBHi1YDUnQ1gO9MkRaRww=; b=IaV3ZgUwE26rp5cB559a9Chs3Y7lb8dUErYt1Zx4GYGneA9h/YWc0O8PgKx3kzHxLC Vhk6HHEBWGf5KLrDpW4Yf3UvnYXyfvXxJXoQdSpAtL4KSrtBWUZIwizFaJemrd+LN6+A rhJH44pst7DUOsC2/0VquOIqACwLXOeJSW/vbk/EikE99kYMbKOIHBPNBeI4NDJw9F9D EchkioXtbhDLnMvKOsnG+gShe4FY95XsopqW0vtyr/OeLP+XxtSwfJiQ6GLcgiHWBVr9 KPmtkCcTqJbIZdwiL0W5/xzwKktTgsm5nK7D97vZDjNhLyC21/5oj/cOt7rNQ4rrWSPT PdGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l22-20020a056402125600b0041d7b3f04e7si2656939edw.333.2022.04.20.22.02.51; Wed, 20 Apr 2022 22:03:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352821AbiDTAqq (ORCPT + 99 others); Tue, 19 Apr 2022 20:46:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59028 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358656AbiDTAqg (ORCPT ); Tue, 19 Apr 2022 20:46:36 -0400 X-Greylist: delayed 61 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 19 Apr 2022 17:43:52 PDT Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::228]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F74E205D3; Tue, 19 Apr 2022 17:43:51 -0700 (PDT) Received: (Authenticated sender: joao@overdrivepizza.com) by mail.gandi.net (Postfix) with ESMTPSA id 5D5D51BF205; Wed, 20 Apr 2022 00:43:45 +0000 (UTC) From: joao@overdrivepizza.com To: linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Cc: joao@overdrivepizza.com, peterz@infradead.org, jpoimboe@redhat.com, andrew.cooper3@citrix.com, keescook@chromium.org, samitolvanen@google.com, mark.rutland@arm.com, hjl.tools@gmail.com, alyssa.milburn@linux.intel.com, ndesaulniers@google.com, gabriel.gomes@linux.intel.com, rick.p.edgecombe@intel.com Subject: [RFC PATCH 10/11] linux/interrupt: Fix prototype matching property Date: Tue, 19 Apr 2022 17:42:40 -0700 Message-Id: <20220420004241.2093-11-joao@overdrivepizza.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220420004241.2093-1-joao@overdrivepizza.com> References: <20220420004241.2093-1-joao@overdrivepizza.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joao Moreira Unions will make function pointers with different prototypes be used through the same call. This leads into the same call instruction being used for calling functions with different prototypes, making them unsuitable for prototype-based fine-grained CFI. Fix this CFI policy violation by removing the function pointer union in the tasklet struct. Signed-off-by: Joao Moreira --- include/linux/interrupt.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index f40754caaefa..8d5504b0f20b 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -650,10 +650,8 @@ struct tasklet_struct unsigned long state; atomic_t count; bool use_callback; - union { - void (*func)(unsigned long data); - void (*callback)(struct tasklet_struct *t); - }; + void (*func)(unsigned long data); + void (*callback)(struct tasklet_struct *t); unsigned long data; }; -- 2.35.1