Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2040592yba; Fri, 17 May 2019 09:24:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPZ3GP+9ZoSPb+zZtV5QX1FJu3vjo1PtBn0wrMToEt3o0b7uuDyp9BnN3ja7z5eYdxHBOT X-Received: by 2002:a65:5941:: with SMTP id g1mr57915891pgu.51.1558110269994; Fri, 17 May 2019 09:24:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558110269; cv=none; d=google.com; s=arc-20160816; b=nto589N9XktvgaCM7bPawqEh4TX1unJOVJZTRNpRbE9GEhsI9tpz0RckXjuhhyQv1f cTBU9nwZawpKFt6s9mcCXU1j0nYNfS1zbW40KuvQCp8vzzSuSfF2GkzwI3hq3wwq27FM ryAaIRf/4LQyleWRHGEpRyFwLNK6ZU6WMllZvs+qX8JnNjLaNBO49TtglFXREUeoM2M9 n22BIUPks4kEuNgLNehGZUkI5Vqgq2Vt6Dv6h/BO1zmyOGa4kQ5tRTppn8lmuZsy3YrK rwZgJKq8pOVEfai7PfnymWoO4csrlhYcVmqSmFz27Z+4ewVL4gWN5uG/Au2wsaNCAgc0 mexg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=Wwt187hQsF2JXTD8bZx5RKT61k3s1eN3rBaXjTcGpy4=; b=CTlRSCleQHqPqHoZ2wlyZQpyeuDUaxvK9X/M3kbJAj0s0BH+2p62POi7yMXtkiFvvs 1rTkh9NbjGw9fzMCiCEKk8q+Wabs4P56DiWxho9bww0E0HC/xqP/013nQPP9ztU6Cigz RfsZxyC+pDpReRZHHETkxQSHxV3mdo0gIMN1iatHzhLsgXvU5ADYAziHrTIMAAjQuIrQ EpAabwE/bKK7xjVmV7ECA8TACvbpEfi78OIM4vHfqZ0+Onfne8hr7ZdcJsSLNM6wg9y/ WCq93ONafxmJO2pd5KqzcbkT/o+T4cp7UhqlorxPEwGqicKfYzPXWPZtn/8asKH+31e3 m0hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=xiRIElES; 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 k5si3847834pgc.322.2019.05.17.09.24.14; Fri, 17 May 2019 09:24:29 -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=@nifty.com header.s=dec2015msa header.b=xiRIElES; 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 S1729167AbfEQQXB (ORCPT + 99 others); Fri, 17 May 2019 12:23:01 -0400 Received: from conssluserg-02.nifty.com ([210.131.2.81]:34752 "EHLO conssluserg-02.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728551AbfEQQXA (ORCPT ); Fri, 17 May 2019 12:23:00 -0400 Received: from mail-ua1-f48.google.com (mail-ua1-f48.google.com [209.85.222.48]) (authenticated) by conssluserg-02.nifty.com with ESMTP id x4HGMVaK003905; Sat, 18 May 2019 01:22:31 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com x4HGMVaK003905 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1558110152; bh=Wwt187hQsF2JXTD8bZx5RKT61k3s1eN3rBaXjTcGpy4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=xiRIElESXDtWVq7AzlQ0N/pqNJjh0Xz/OKLBeufz+nXY6ec+hHLBNjdxpUUJGGpfk fhJXOST+ZCI9Z0HQ0SNVNc9S43NTZy/yWhUH7KItRI6Qv7Q7QVP+tt5aYiQiSLvNSd yq6pzu5OEVh54tEUmndnoHyZpbm5lw6q/GXWuaw0PLhj0pZKESqr2x07hAPNmwNrkd nhPXrOLoOi4mtx/M9wUDXw+nJit+AEi73O8/3OdEhM0vBgiIIfPryYfunLnTXSLkyS WX1C8Qh4vVvHT37SY8TIvPnTIgeCD2TYbUvc7fCATAgKzzd8hGV2VjqDnhJhwLfgwU k9B95XHAi5mWQ== X-Nifty-SrcIP: [209.85.222.48] Received: by mail-ua1-f48.google.com with SMTP id u4so2891470uau.10; Fri, 17 May 2019 09:22:31 -0700 (PDT) X-Gm-Message-State: APjAAAU3IjALMz5T/YHE96TFI2IRnGoJF2coBdmMEJgEZw5fIKnHGlqr qG7a3hLG12EUikLXXJYR9kvRB+n3lHynACJvOMo= X-Received: by 2002:a9f:366b:: with SMTP id s40mr2324205uad.121.1558110150398; Fri, 17 May 2019 09:22:30 -0700 (PDT) MIME-Version: 1.0 References: <20190517042753.25857-1-yamada.masahiro@socionext.com> <20190517053658.GA3464@kroah.com> In-Reply-To: From: Masahiro Yamada Date: Sat, 18 May 2019 01:21:53 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] kbuild: check uniqueness of module names To: Lucas De Marchi Cc: Greg KH , Linux Kbuild mailing list , Sam Ravnborg , Arnd Bergmann , Jessica Yu , Stephen Rothwell , Michael Schmitz , Linus Torvalds , Rusty Russell , Kees Cook , Michal Marek , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 17, 2019 at 2:46 PM Lucas De Marchi wrote: > > On Thu, May 16, 2019 at 10:37 PM Greg KH wrote: > > > > On Fri, May 17, 2019 at 01:45:11PM +0900, Masahiro Yamada wrote: > > > On Fri, May 17, 2019 at 1:29 PM Masahiro Yamada > > > wrote: > > > > > > > > In the recent build test of linux-next, Stephen saw a build error > > > > caused by a broken .tmp_versions/*.mod file: > > > > > > > > https://lkml.org/lkml/2019/5/13/991 > > > > > > > > drivers/net/phy/asix.ko and drivers/net/usb/asix.ko have the same > > > > basename, and there is a race in generating .tmp_versions/asix.mod > > > > > > > > Kbuild has not checked this before, and it suddenly shows up with > > > > obscure error message when this kind of race occurs. > > > > > > > > Non-unique module names cause various sort of problems, but it is > > > > not trivial to catch them by eyes. > > > > > > > > Hence, this script. > > > > > > > > It checks not only real modules, but also built-in modules (i.e. > > > > controlled by tristate CONFIG option, but currently compiled with =y). > > > > Non-unique names for built-in modules also cause problems because > > > > /sys/modules/ would fall over. > > > > > > > > I tested allmodconfig on the latest kernel, and it detected the > > > > following: > > > > > > > > warning: same basename if the following are built as modules: > > > > drivers/regulator/88pm800.ko > > > > drivers/mfd/88pm800.ko > > > > warning: same basename if the following are built as modules: > > > > drivers/gpu/drm/bridge/adv7511/adv7511.ko > > > > drivers/media/i2c/adv7511.ko > > > > warning: same basename if the following are built as modules: > > > > drivers/net/phy/asix.ko > > > > drivers/net/usb/asix.ko > > > > warning: same basename if the following are built as modules: > > > > fs/coda/coda.ko > > > > drivers/media/platform/coda/coda.ko > > > > warning: same basename if the following are built as modules: > > > > drivers/net/phy/realtek.ko > > > > drivers/net/dsa/realtek.ko > > > > > > > > Reported-by: Stephen Rothwell > > > > Signed-off-by: Masahiro Yamada > > > > Reviewed-by: Kees Cook > > > > --- > > > > > > > > > One more question popped up. > > > > > > External modules are out of scope of the community, > > > but it is possible that people create an external module > > > that happens to have the same name as an upstream driver. > > > > That is their bug, nothing we can do about that :) > > It's actually not a bug. For external modules it works pretty much as > intended. See DEPMOD.D(5): the search directive tells what's the > preference among the directories for modules with the same name. > depmod respects that order and put the right one into your > modules.dep. > > This allows to put external modules in a different dir and also to > make backports of modules from recent to ancient kernels. These > modules with the same name are usually the same module, with a > different version. Of course what we have here and you are fixing is a > different story. OK, so external modules should not be checked. Thanks for the explanation! > Reviewed-by: Lucas De Marchi > > > Lucas De Marchi -- Best Regards Masahiro Yamada