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=-5.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 DE6A7C63697 for ; Tue, 17 Nov 2020 21:33:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 74E3A2463F for ; Tue, 17 Nov 2020 21:33:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="JFYvqSNq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727271AbgKQVdp (ORCPT ); Tue, 17 Nov 2020 16:33:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726020AbgKQVdp (ORCPT ); Tue, 17 Nov 2020 16:33:45 -0500 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B696C0617A7 for ; Tue, 17 Nov 2020 13:33:44 -0800 (PST) Received: by mail-pf1-x441.google.com with SMTP id q10so32951pfn.0 for ; Tue, 17 Nov 2020 13:33:44 -0800 (PST) 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=hUaB1zwScjx73jhxVMuBCb5j2bh6ePTktk1ke7nr9rk=; b=JFYvqSNqyi4WhfbIp8cznUcs2B9EvtWy2hnInFGybxvfY79lwudK2stuMO8nvlv4XK dUr06/LEkH+jmcdsoS2Ya6OzOxRiYK8Z+KmTEE5w3TwzgOUuXmVguB/estmpbHKih0T7 tVbw6PH7wSritwPoPqrt8evxWiu5nvTInDgpA= 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=hUaB1zwScjx73jhxVMuBCb5j2bh6ePTktk1ke7nr9rk=; b=hEzLy9EvjAzKNNBLvsTEY1rG3gdtW5gPq/UXhhaH5iUH1w4aLkNLYkaNcQ/b4Oz2aK ZXDDDTIQZxxin4KawsUqqHWOhs2+/rKjBepWDDdD+oUFiTDaiWNZFfCaEq7CHzm2fZmv o2Tc8vhRW2Va0o8hAwpVwduYKSJWgrBuuXvivoeCVQ3JiM5M8oVccf+4iOrPRkK1B6/K r70ilXSw0BoIiPjPuAqmQRvgwqtxy6zrCeHV31P8U1QwjpfVVO5e2b+ij/qBEzzxgI+s b9d3JUZIGbDu2x3B1sO+UokDwR0qpggcsRliB4y/vnrptD3E4uREGgXtNuAndWbAEsvb Fqag== X-Gm-Message-State: AOAM532p1sHI3jZygNtwDfbnkNZsvotpBdPZlHzYpZ8VEG+5NQNA1qME bLit9rcix2CUzRCuwVK//rbwgA== X-Google-Smtp-Source: ABdhPJzFakl4956d7dKMtPc85C9GfV9iMBAYJF5OBe+F6BC+H4Lh6E/Jlr0KWJRdwKJeGq67ZTPxXA== X-Received: by 2002:a63:6c81:: with SMTP id h123mr1073673pgc.401.1605648824004; Tue, 17 Nov 2020 13:33:44 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id a3sm3659073pgq.53.2020.11.17.13.33.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 13:33:43 -0800 (PST) Date: Tue, 17 Nov 2020 13:33:42 -0800 From: Kees Cook To: Steven Rostedt Cc: LKML , Mathieu Desnoyers , 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 Subject: Re: [PATCH] tracepoint: Do not fail unregistering a probe due to memory allocation Message-ID: <202011171330.94C6BA7E93@keescook> References: <20201116175107.02db396d@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201116175107.02db396d@gandalf.local.home> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 16, 2020 at 05:51:07PM -0500, Steven Rostedt wrote: > [ Kees, I added you because you tend to know about these things. > Is it OK to assign a void func(void) that doesn't do anything and returns > nothing to a function pointer that could be call with parameters? We need > to add stubs for tracepoints when we fail to allocate a new array on > removal of a callback, but the callbacks do have arguments, but the stub > called does not have arguments. > > Matt, Does this patch fix the error your patch was trying to fix? > ] As I think got discussed in the thread, what you had here wouldn't work in a CFI build if the function prototype of the call site and the function don't match. (Though I can't tell if .func() is ever called?) i.e. .func's prototype must match tp_stub_func()'s. -- Kees Cook