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=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 06A49C48BE9 for ; Mon, 24 Jun 2019 17:51:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D2A6420665 for ; Mon, 24 Jun 2019 17:51:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=efficios.com header.i=@efficios.com header.b="rLqqpYL/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731945AbfFXRu7 (ORCPT ); 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: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@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