Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp341504pxb; Wed, 18 Nov 2020 06:05:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJxL65GVsdKV/FU1D2EuBPrPMl47tkoQ9YOgPYM3Kv59ePohVVOYAueOEZmidyOeGo9V+DWz X-Received: by 2002:adf:d083:: with SMTP id y3mr4935753wrh.261.1605708304971; Wed, 18 Nov 2020 06:05:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605708304; cv=none; d=google.com; s=arc-20160816; b=AsJkRjE1CID7vMlVDuRRfLzZX86PHgw3tnmlm38kGcm4j40ZHF7Bv+AnyJcm91he/s S/jiJMSIFEYvrw34MYoRv3bIxG5wiuYxw8ggQtQTIXxn3iE/ufC5qIsH2ohIN61xfHB7 06aWMvlllJTuuBuv4/XGbuS4iSVVw1JqtHUw/L72mmbMfnHsr5C9gLJJESAVQyA1+7n7 49A/urbA1//0XmerczGk2Ev84TMgPwyK5xO9JpPLjPuRkA2QMFKZupNzW7kLNVqUdweI PnVA/vsQdpdkxOLxM02KIVfsteApYtWydoFoPJpVBKLyGqBZqUHwOAUKuQL5Nna1dnx2 tBaw== 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:subject:cc:to:from:date; bh=lpGirz6kDV1KtxdwuvKbkFoH3ENwJ/h84m4xmZaPCuw=; b=lZaq0/igr26w68g4mE6aPEyNQWCexOUscz1YVqz8UYwy25vZkHSL4vOT66ju9j9L3g qgXgkhmYriKaJABlxLL96HnHuIfCDJ/uie3mr5/xd8MB7CYMsvXKU0CRlxNIh7z5Xm9E 9Yv24W1sIdeyC7R2aBK6qPtsX6wCqsNnOzSAe4f2VSeOkOLALTnq6n+NKr1uby6Us+cP haDoRZ+tv9vIOCi6sBxw4XLGWs4n1WrLx9SOgX9IZcNywgsMHdloj+ZU9qb3+/wkfyZu XTX7ykcTq1Ue0QenpA2W8p+t53xB4o/gywi3d4Xf0Jg16KwZelE5DJO+4Y2E4mZrKRwt RvBg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dp16si17821593ejc.635.2020.11.18.06.04.41; Wed, 18 Nov 2020 06:05:04 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726019AbgKRODE (ORCPT + 99 others); Wed, 18 Nov 2020 09:03:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:43422 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726433AbgKRODA (ORCPT ); Wed, 18 Nov 2020 09:03:00 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 00E062080A; Wed, 18 Nov 2020 14:02:57 +0000 (UTC) Date: Wed, 18 Nov 2020 09:02:56 -0500 From: Steven Rostedt To: Peter Zijlstra Cc: Mathieu Desnoyers , linux-kernel , Matt Mullins , Ingo Molnar , Alexei Starovoitov , Daniel Borkmann , Dmitry Vyukov , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , John Fastabend , KP Singh , netdev , bpf , Kees Cook , Josh Poimboeuf , linux-toolchains@vger.kernel.org Subject: Re: violating function pointer signature Message-ID: <20201118090256.55656208@gandalf.local.home> In-Reply-To: <20201118132136.GJ3121378@hirez.programming.kicks-ass.net> References: <20201116175107.02db396d@gandalf.local.home> <47463878.48157.1605640510560.JavaMail.zimbra@efficios.com> <20201117142145.43194f1a@gandalf.local.home> <375636043.48251.1605642440621.JavaMail.zimbra@efficios.com> <20201117153451.3015c5c9@gandalf.local.home> <20201118132136.GJ3121378@hirez.programming.kicks-ass.net> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 18 Nov 2020 14:21:36 +0100 Peter Zijlstra wrote: > I think that as long as the function is completely empty (it never > touches any of the arguments) this should work in practise. > > That is: > > void tp_nop_func(void) { } My original version (the OP of this thread) had this: +static void tp_stub_func(void) +{ + return; +} > > can be used as an argument to any function pointer that has a void > return. In fact, I already do that, grep for __static_call_nop(). > > I'm not sure what the LLVM-CFI crud makes of it, but that's their > problem. If it is already done elsewhere in the kernel, then I will call this precedence, and keep the original version. This way Alexei can't complain about adding a check in the fast path of more than one callback attached. -- Steve