Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp2994549ybn; Thu, 26 Sep 2019 22:33:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOHP96M6/2D1u8Brkddf2LEbXkQqkFBGp5guVpSq8FuysldE6mDdvHgSIFeBztKZxnP5lJ X-Received: by 2002:a05:6402:1549:: with SMTP id p9mr2532897edx.221.1569562420137; Thu, 26 Sep 2019 22:33:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569562420; cv=none; d=google.com; s=arc-20160816; b=QE6brgh8sV6bquOpfrkGhk1yhjVCJP7lqMPA3pKR3bZDzV3XveUeGRkPLVJl6XNUUt V/jOQ9nDVjh32C1Q1Tb8GIirXAxEju7xSnAbucLjopnsXDisFYkcepZO+n7HovFdh92p fmJ0J2hpLF9GnKZnSPyGXKGHi7Gm1y65gxZY1OOu4pQh3VSqyuQrLPTasdcWareG+cs+ mN9bDyNI/NCkPCZ3GoV7Zw7jnrn2bGsrXKPwZ0K/4CLfUmL8gWHcBFK+0CWqOzvjD3qm jvMQKQnv2E9UTNCJL5wpxbOVZq7PdPCiSVua8uHndIkdu7MLm2wwMPKNUq/NrVi6jam0 c+dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=W0tkCNrqQE+FbhDyMX+mb+SKhZOgj3ZtrWSky9ZxY40=; b=ww/hpCQ0DkqCJ9widJGl49zeKNEaTw1ZBdjGjoAgmZFMyDv73VolbTDF3k4LBBYsFh fbrmmg5qJUCHjHFngYv4TZCIw1xHsst7yA4Q+eihYPlSkQq7Bt+pB6u/NY4RwR5sZcYw Ge/azQqw3/swPHrj/MFiu8TLcAPPalMlR06wuox2hatnUW8t+L51hZXzY+n+4HRHGIEM Ohi2RRKJyMQgRcz4QEFto3Gf5aVnqFLa77PlSn4yhmc+m2N0P7VExDcr/rXkQj+58uE/ U/Id6xhu1Lx6dYpqNCmcxIeYfne6U47KdQYuzcEGJllDi+jxvh8+8yAbT2kc7sXiSPLy yaow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bek41nOQ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h42si908991eda.90.2019.09.26.22.33.13; Thu, 26 Sep 2019 22:33:40 -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=@kernel.org header.s=default header.b=bek41nOQ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725819AbfI0FbR (ORCPT + 99 others); Fri, 27 Sep 2019 01:31:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:38052 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725800AbfI0FbQ (ORCPT ); Fri, 27 Sep 2019 01:31:16 -0400 Received: from localhost (unknown [62.119.166.9]) (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 DD3B920872; Fri, 27 Sep 2019 05:31:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569562276; bh=b1Jjpebwjo+hSOp77MSaaQmC5zmGryJcUvrk+YALm+E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bek41nOQJPaF14byVp+Nj/5tEwap5q6vOtUf07CZXSfIV87Jemt6udrPxDZdmC03o J4zuD1t8eG6wxagD42XaYKgSeolIA39HiMCCctTiTNxqw9IjCkC/MeibzuXSc9n+Bz XwQWU61F6005VPfEH4kfLOwENcPxdIgQ+AUh/A7s= Date: Fri, 27 Sep 2019 07:31:01 +0200 From: Greg Kroah-Hartman To: Shaun Ruffell Cc: linux-kernel@vger.kernel.org, Martijn Coenen , Joel Fernandes , Matthias Maennich , Jessica Yu Subject: Re: [PATCH] modpost: Copy namespace string into 'struct symbol' Message-ID: <20190927053101.GA1781519@kroah.com> References: <20190906103235.197072-5-maennich@google.com> <20190926222446.30510-1-sruffell@sruffell.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190926222446.30510-1-sruffell@sruffell.net> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 26, 2019 at 05:24:46PM -0500, Shaun Ruffell wrote: > When building an out-of-tree module I was receiving many warnings from > modpost like: > > WARNING: module dahdi_vpmadt032_loader uses symbol __kmalloc from namespace ts/dahdi-linux/drivers/dahdi/dahdi-version.o: ..., but does not import it. > WARNING: module dahdi_vpmadt032_loader uses symbol vpmadtreg_register from namespace linux/drivers/dahdi/dahdi-version.o: ..., but does not import it. > WARNING: module dahdi_vpmadt032_loader uses symbol param_ops_int from namespace ahdi-linux/drivers/dahdi/dahdi-version.o: ..., but does not import it. > WARNING: module dahdi_vpmadt032_loader uses symbol __init_waitqueue_head from namespace ux/drivers/dahdi/dahdi-version.o: ..., but does not import it. > ... > > The fundamental issue appears to be that read_dump() is passing a > pointer to a statically allocated buffer for the namespace which is > reused as the file is parsed. > > This change makes it so that 'struct symbol' holds a copy of the > namespace string in the same way that it holds a copy of the symbol > string. Because a copy is being made, handle_modversion can now free the > temporary copy > > Fixes: cb9b55d21fe0 ("modpost: add support for symbol namespaces") > Cc: Martijn Coenen > Cc: Joel Fernandes (Google) > Cc: Greg Kroah-Hartman > Cc: Matthias Maennich > Cc: Jessica Yu > Signed-off-by: Shaun Ruffell > --- > > Hi, > > I didn't test that this change works with the namespaces, or investigate why > read_dump() is only called first while building out-of-tree modules, but it does > seem correct to me for the symbol to own the memory backing the namespace > string. > > I also realize I'm jumping the gun a bit by testing against master before > 5.4-rc1 is tagged. Yes!!! This fixes the issue that I reported to Mattias a few days ago on irc. I am hitting this by just trying to build a single directory work of modules: make M=drivers/usb/ I just tested this patch and it works for me, thanks so much! Tested-by: Greg Kroah-Hartman