Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2860947ybd; Mon, 24 Jun 2019 14:10:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpshIKTzpCwQKZ/ZFy2LwKO8YyA/IRhCgou/NyaDwY33UAvo1GqB3Uv56ptTkrBmd9FT7q X-Received: by 2002:a65:4009:: with SMTP id f9mr34790559pgp.110.1561410636182; Mon, 24 Jun 2019 14:10:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561410636; cv=none; d=google.com; s=arc-20160816; b=wNnUVjrvZsJJwXbwzRNKHTxer+QbhYR1vCRANv4PPvrAcLdT2/j/B164JGYwitPl/P lbUsoaJbN643DcdsoqIZzkU/qq5pUmTtJx7jEEWeKn3VbsA4Cc4GgnJuJmrmdUIY6dMn f2LdQiYBBINkilBizoN6ao2DU2II16YLmBEdX1OMSsuH4077EA2OPy5+uBXYDsu3Tywb g6Jt2T3E7wgW+HSho5x7xLJu3yH7B+hKjdfAypyoKJiMvFyT7/MY7nQkmQBkAaRNs6hB wsXe1tgz+EBvbJMXho5wjUTZMPdnYjkxCoSghayOU11kz9Cg9LaHjnZY7O47ccVmNtfh BzHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:dkim-signature:dkim-filter; bh=YgTDjKzulnpRdHN03BOtIF36ow3kBCQn4Ff76WlCgv4=; b=GYknJndLwzSyAhpAdZUvOku8U4K8ISH2Ekx+8A9rVnmH2Th9nYqBMBBv/vTcAMXwSp T3dH/inq0Hkl6GOh+nle5AL2mu5seo6ZheuiORVOwEZvDJ5BsnSZrNy1LhUFf7bf8XDW 5+Z+/Rg2i1S8eOS+LTFI6ziGz5ZN6PW7ZRqctstwRP06slcFFY56QLsGJ+MHNmsrszV+ sZU2y4rc4Gg/FNPHWD/nkUkuZwZyphvbe0PglSrFd3DyD/dRd0P0fWgc7JVT/6huylXk Bnoz/VEBtvYPM5HuLMGjdKs9qTxcr/6u6BAyMFb4hUSpS6k8zSK1Jx1YueZLSO1y12do WY/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b="rLqqpYL/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n3si10712681pgh.53.2019.06.24.14.10.19; Mon, 24 Jun 2019 14:10:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=default header.b="rLqqpYL/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731951AbfFXRu7 (ORCPT + 99 others); Mon, 24 Jun 2019 13:50:59 -0400 Received: from mail.efficios.com ([167.114.142.138]:56186 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726451AbfFXRu6 (ORCPT ); Mon, 24 Jun 2019 13:50:58 -0400 Received: from localhost (ip6-localhost [IPv6:::1]) by mail.efficios.com (Postfix) with ESMTP id 048B225B682; Mon, 24 Jun 2019 13:50:57 -0400 (EDT) Received: from mail.efficios.com ([IPv6:::1]) by localhost (mail02.efficios.com [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id kubqiW463fQT; Mon, 24 Jun 2019 13:50:56 -0400 (EDT) Received: from localhost (ip6-localhost [IPv6:::1]) by mail.efficios.com (Postfix) with ESMTP id 7489F25B67D; Mon, 24 Jun 2019 13:50:56 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.efficios.com 7489F25B67D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficios.com; s=default; t=1561398656; bh=YgTDjKzulnpRdHN03BOtIF36ow3kBCQn4Ff76WlCgv4=; h=Date:From:To:Message-ID:MIME-Version; b=rLqqpYL/J/9XfjfblU5xlkvGWUSmihnJQ1Jj+o+LyOs12tFBNAr1nEfFtsTTbHkTC z3JpCf3sxds6+xj+N6N+eAdu7PLH7IjyKqW4xBvTXwFly76m0Z2u1YBoTOLJczUkM0 af9cCewWfDNX+TUVdoyv4nYvprFyIJtB1nvenD1tXHWmGLa8EHo2puqwvwnu2QYy1W PvyXm2wRevcjxansTh7n/NsUEb3gbqk1qJ6384uCbaMkHkEfq9bKz3fzKAtgks5juq 4N4+Q4+vUaz04xgJ2Fxkw02Rkug7uDoWxy7xwJKtj0Bu9sdZNz+g/zGn2CWy9wYqoC 9BAjlgFEQGuLA== X-Virus-Scanned: amavisd-new at efficios.com Received: from mail.efficios.com ([IPv6:::1]) by localhost (mail02.efficios.com [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id 6I-HKbAyDBuh; Mon, 24 Jun 2019 13:50:56 -0400 (EDT) Received: from mail02.efficios.com (mail02.efficios.com [167.114.142.138]) by mail.efficios.com (Postfix) with ESMTP id 575FD25B675; Mon, 24 Jun 2019 13:50:56 -0400 (EDT) Date: Mon, 24 Jun 2019 13:50:56 -0400 (EDT) From: Mathieu Desnoyers To: "Joel Fernandes, Google" Cc: Peter Zijlstra , "Frank Ch. Eigler" , Jessica Yu , linux-kernel , Josh Poimboeuf , jikos , mbenes , Petr Mladek , Alexei Starovoitov , Daniel Borkmann , Andrew Morton , Robert Richter , rostedt , Ingo Molnar , Martin KaFai Lau , Song Liu , Yonghong Song , paulmck , Ard Biesheuvel , Thomas Gleixner , oprofile-list , netdev , bpf Message-ID: <2125299316.352.1561398656224.JavaMail.zimbra@efficios.com> In-Reply-To: <20190624155213.GB261936@google.com> References: <20190624091843.859714294@infradead.org> <20190624092109.805742823@infradead.org> <320564860.243.1561384864186.JavaMail.zimbra@efficios.com> <20190624155213.GB261936@google.com> Subject: Re: [PATCH 2/3] module: Fix up module_notifier return values. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [167.114.142.138] X-Mailer: Zimbra 8.8.12_GA_3803 (ZimbraWebClient - FF67 (Linux)/8.8.12_GA_3794) Thread-Topic: module: Fix up module_notifier return values. Thread-Index: YqiVsEGYR43tan1IptAyCZzN3mIl4w== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- On Jun 24, 2019, at 11:52 AM, Joel Fernandes, Google joel@joelfernandes.org wrote: > On Mon, Jun 24, 2019 at 10:01:04AM -0400, Mathieu Desnoyers wrote: >> ----- On Jun 24, 2019, at 5:18 AM, Peter Zijlstra peterz@infradead.org wrote: >> >> > While auditing all module notifiers I noticed a whole bunch of fail >> > wrt the return value. Notifiers have a 'special' return semantics. >> > >> > Cc: Robert Richter >> > Cc: Steven Rostedt >> > Cc: Ingo Molnar >> > Cc: Alexei Starovoitov >> > Cc: Daniel Borkmann >> > Cc: Martin KaFai Lau >> > Cc: Song Liu >> > Cc: Yonghong Song >> > Cc: Mathieu Desnoyers >> > Cc: "Paul E. McKenney" >> > Cc: "Joel Fernandes (Google)" >> > Cc: Ard Biesheuvel >> > Cc: Thomas Gleixner >> > Cc: oprofile-list@lists.sf.net >> > Cc: linux-kernel@vger.kernel.org >> > Cc: netdev@vger.kernel.org >> > Cc: bpf@vger.kernel.org >> > Signed-off-by: Peter Zijlstra (Intel) >> >> Thanks Peter for looking into this, especially considering your >> endless love for kernel modules! ;) >> >> It's not directly related to your changes, but I notice that >> kernel/trace/trace_printk.c:hold_module_trace_bprintk_format() >> appears to leak memory. Am I missing something ? > > Could you elaborate? Do you mean there is no MODULE_STATE_GOING notifier > check? If that's what you mean then I agree, there should be some place > where the format structures are freed when the module is unloaded no? Yes, the lack of GOING notifier is worrying considering that GOING performs memory allocation. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com