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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 B93DEC64E69 for ; Wed, 18 Nov 2020 18:32:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 863FD21734 for ; Wed, 18 Nov 2020 18:32:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726752AbgKRScV (ORCPT ); Wed, 18 Nov 2020 13:32:21 -0500 Received: from albireo.enyo.de ([37.24.231.21]:43476 "EHLO albireo.enyo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726629AbgKRScV (ORCPT ); Wed, 18 Nov 2020 13:32:21 -0500 Received: from [172.17.203.2] (helo=deneb.enyo.de) by albireo.enyo.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1kfSFC-0006nX-JX; Wed, 18 Nov 2020 18:31:50 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.92) (envelope-from ) id 1kfSFC-0005cN-Gh; Wed, 18 Nov 2020 19:31:50 +0100 From: Florian Weimer To: Segher Boessenkool Cc: Steven Rostedt , Nick Desaulniers , Peter Zijlstra , Sami Tolvanen , 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 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> <20201118121730.12ee645b@gandalf.local.home> <20201118181226.GK2672@gate.crashing.org> Date: Wed, 18 Nov 2020 19:31:50 +0100 In-Reply-To: <20201118181226.GK2672@gate.crashing.org> (Segher Boessenkool's message of "Wed, 18 Nov 2020 12:12:26 -0600") Message-ID: <87o8jutt2h.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org * Segher Boessenkool: > On Wed, Nov 18, 2020 at 12:17:30PM -0500, Steven Rostedt wrote: >> I could change the stub from (void) to () if that would be better. > > Don't? In a function definition they mean exactly the same thing (and > the kernel uses (void) everywhere else, which many people find clearer). And I think () functions expected a caller-provided parameter save area on powerpc64le, while (void) functions do not. It does not matter for an empty function, but GCC prefers to use the parameter save area instead of setting up a stack frame if it is present. So you get stack corruption if you call a () function as a (void) function. (The other way round is fine.)