Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3184925ioa; Mon, 25 Apr 2022 20:41:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoZiGUe4xGZeZFsPJfH+evT+vrHaYiCi8ErgPYh6VbLOh9SRW5tcUNpGySWCTxud873ALS X-Received: by 2002:a17:902:f689:b0:15b:66c7:e503 with SMTP id l9-20020a170902f68900b0015b66c7e503mr21612544plg.112.1650944482083; Mon, 25 Apr 2022 20:41:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650944482; cv=none; d=google.com; s=arc-20160816; b=SrsBKQyGQ4DDURC8buaHFq1hT2bAoT70eS8kUh/WdNE7BF+YI/mUB3Esme+FuJFROV ELvN9e8GAnHlGwxzIv4jSEZWR3Heo2iNzC2ZLBpayTtoBQR8hEXdOT3U63ZT8drovlTg 9+vOq6QKmDwDGZ4tW5k7m9n04C+9+e+FJ0GVNSLbLasze1cr1SQBqUU1mXlTaq/4QMgm WeEde1rbkLtjdNtVOZ5b+yqB+33OGWQbr61CzKNxiX7OPfCNvac3WcmDTU2JwGhV7Z+j tprx3gpE/0JkzdTm5CMeetK6kxjR/8gRFT49N5PadfptY7hWeSehOOE2XdJiyLHgS6E+ SIZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=qMnY4WbVpAxmQ/4X6WWLsIMxUBHKSMbpS3kcgrtCpFs=; b=NFicje1kt+IFX4AUjOnvg70Lg4ihL2/uVi8fgKGxIEg65iH+FIKCtMHIbpaYvOuBDQ Eu8sV2rkmbLtqX+m4ZWoszoa6k5W5saMg1Io/TVzFpQnzNNr4DsnKy/ygA8ekLGweMgD KC+7fgwn7kUKpVEu2qErUV/rVGc3AaueR8iyHqX8AU6fJw4J8LQsJZQIGol2LOfW0nIM HjWqmsa4fouwYJdB8bnzYOg/zcRhKyYDB1Mm8n7KtpeS1J11EgD4QeyjiYLRwHClyuSW bHqorYKr4zgU5c96xNc0fPOy8m62m1tt2lxRq8MBjlrR3vh5osl+mczADVrf9d/Yi58f gXZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=wpbFIwSl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t8-20020a17090abc4800b001d0adade18bsi1233016pjv.0.2022.04.25.20.41.06; Mon, 25 Apr 2022 20:41:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=wpbFIwSl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237959AbiDYXfD (ORCPT + 99 others); Mon, 25 Apr 2022 19:35:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237895AbiDYXfC (ORCPT ); Mon, 25 Apr 2022 19:35:02 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DD736AA69; Mon, 25 Apr 2022 16:31:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=qMnY4WbVpAxmQ/4X6WWLsIMxUBHKSMbpS3kcgrtCpFs=; b=wpbFIwSlzpm6J9Osh6cHP+j3IH O51zNvj2lWTwt+74/Gomgb0sgotJiLmGAXEFCfHoIo5+vAr3SiXyNfOIHrsVgWJMYJuRYpwXBrW8C sgDnGIB+99uWHFhFbOb/d5yG9H7ZFCgUfYXSMJg0zFwUMEmtiYPZszT4+ljOMfedEzdrmcY9917CW 37qJYdajQhWUBQcFNEeuqAVQOODqy4SYIp05YJUfNiW5GCuNQSQG6LUJpBK/GJtdfO8ha8WHoS6EV lwoDBfZHwBZ318RFCviqoeWCj0PpYIG607lp59IqFHl7w+zynVh3a3QygHhkE5qw8iFmlfM/xnElj +YBIJaaw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nj8BJ-00BjPh-H3; Mon, 25 Apr 2022 23:31:49 +0000 Date: Mon, 25 Apr 2022 16:31:49 -0700 From: Luis Chamberlain To: Aaron Tomlin Cc: cl@linux.com, pmladek@suse.com, mbenes@suse.cz, christophe.leroy@csgroup.eu, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, atomlin@atomlin.com, ghalat@redhat.com, oleksandr@natalenko.name, neelx@redhat.com Subject: Re: [PATCH v4 0/2] module: Introduce module unload taint tracking Message-ID: References: <20220425090841.3958494-1-atomlin@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220425090841.3958494-1-atomlin@redhat.com> Sender: Luis Chamberlain X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 25, 2022 at 10:08:39AM +0100, Aaron Tomlin wrote: > Hi Luis, > > This iteration is still based on the latest mcgrof/modules-next branch. > > I have decided still to use RCU even though no entry is ever removed from > the unloaded tainted modules list. That being said, if I understand > correctly, it is not safe in some instances to use 'module_mutex' in > print_modules(). So instead we disable preemption to ensure list traversal > with concurrent list manipulation e.g. list_add_rcu(), is safe too. > > Changes since v3 [1] > - Fixed kernel build error reported by kernel test robot i.e. moved > '#endif' outside 'if (!list_empty(&unloaded_tainted_modules))' > statement in the context of print_modules() > - Used strncmp() instead of memcmp() > (Oleksandr Natalenko) > - Removed the additional strlen() > (Christoph Lameter) > > Changes since v2 [2] > - Dropped RFC from subject > - Removed the newline i.e. "\n" in printk() > - Always include the tainted module's unload count > - Unconditionally display each unloaded tainted module > > Please let me know your thoughts. This all looks good except with all the work you did to remove #ifdef hell, it gets me wondering why not just use a new file for this? What does that look like? Luis