Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2922043imu; Sun, 9 Dec 2018 12:38:16 -0800 (PST) X-Google-Smtp-Source: AFSGD/W9kakmL3ehFzYkZLYFsmIlOD8t1KE9BXRajbQk00kngogJ/SY4ckAJZZmYuMZu1Bva1N8x X-Received: by 2002:a62:8949:: with SMTP id v70mr9630624pfd.85.1544387896302; Sun, 09 Dec 2018 12:38:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544387896; cv=none; d=google.com; s=arc-20160816; b=LdtVa2NvezOvi20eh6XZjyRvnyACKLwawc6B4uOeuRpOD1pm1LQyMJ5bO8/+9tlZE+ gJDOm1K2683yWe72m6gzwKF9SESzeGmQUHgXMos6BpmjZch7oIzjq0lag9O7STqtgxKh mMSj35fXRciLsVnUr3ojL4sEAoF2bf79svnjXKHFJrZY+Q9zJqvfoV9VOtHKDP3ufJ85 +p9rmq2Y1ddfiU7dEfwpqxgIMc1D/AEuS/sviWs/7JA99LVJo+rBMBS7sB5A0UDOEFIc BB+0RT7aICOwr5w0+qDO17eypiob44IWcB75Lwn2rxURpSpo9/DPjjLFqnAYM3MxEjwJ 7o/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=QwGws0hEAlJBLasIlwFag2UssS/7GAAbo409r58A9F4=; b=EkCdbnNoKuBTlcs7qE1JIsUo9a497VCfND6akbwf+HbqU91FsLAME+2lqMK04+eDwH Izg3hVJ0z6B7AxBfS0eiAuaUHq3WmCrG8LY/CmXYUuzzIZJgwGcs3ZLk2FiYBfFG6x97 3MBcHeLQlI+5Ea4xgKROwGD0HJJFgEw9p1ZR21/8BGVEnUJX7VMeBhPUrEeGmCXh692t xJIKuOj3Xm1YMO3xXqG1LN39PpD+TVkVdS2JY+QqxMundu7zTBDFBd3zcd0Izg+OoaxM k3OrL4GXC14Eh5OVnKjjGs/euowlSu+RHCxseyVBQb7Qpl/VLXLZ1kutDyLcCwuHqGCr 5jyQ== ARC-Authentication-Results: i=1; mx.google.com; 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 g1si7926092pgj.34.2018.12.09.12.38.01; Sun, 09 Dec 2018 12:38:16 -0800 (PST) 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; 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 S1726304AbeLIUhR (ORCPT + 99 others); Sun, 9 Dec 2018 15:37:17 -0500 Received: from mail.windriver.com ([147.11.1.11]:32967 "EHLO mail.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726219AbeLIUhP (ORCPT ); Sun, 9 Dec 2018 15:37:15 -0500 Received: from ALA-HCA.corp.ad.wrs.com ([147.11.189.40]) by mail.windriver.com (8.15.2/8.15.1) with ESMTPS id wB9Kal5H020405 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Sun, 9 Dec 2018 12:36:48 -0800 (PST) Received: from yow-cube1.wrs.com (128.224.56.98) by ALA-HCA.corp.ad.wrs.com (147.11.189.40) with Microsoft SMTP Server id 14.3.408.0; Sun, 9 Dec 2018 12:36:47 -0800 From: Paul Gortmaker To: CC: , Paul Gortmaker , David Howells , Dmitry Kasatkin , James Morris , John Johansen , Mimi Zohar , "Serge E. Hallyn" , , , Subject: [PATCH 0/5] security: remove needless usage of module header Date: Sun, 9 Dec 2018 15:36:28 -0500 Message-ID: <1544387793-32309-1-git-send-email-paul.gortmaker@windriver.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The most important thing to note here, is these clean-ups make no changes to the object files or the final generated run-time. The work here represents a scan over the security dir, looking for files that have nothing to do with a modular use case, but are using modular infrastructure regardless. We are trying to make driver code consistent with the Makefiles/Kconfigs that control them. This means not using modular functions/macros for drivers that can never be built as a module. This has been done in quite a lot of other mainline subsystem dirs already. Using modular infrastructure in non-modules might seem harmless, but some of the downfalls this leads to are: (1) it is easy to accidentally write unused module_exit and remove code (2) it can be misleading when reading the source, thinking it can be modular when the Makefile and/or Kconfig prohibit it (3) it requires the include of the module.h header file which in turn includes nearly everything else, thus adding to CPP overhead. (4) it gets copied/replicated into other drivers and spreads quickly. As a data point for #3 above, an empty C file that just includes the module.h header generates over 750kB of CPP output. Repeating the same experiment with init.h and the result is less than 12kB; with export.h it is only about 1/2kB; with both it still is less than 12kB. We start with the simple ones - removing from where it simply isn't required. Then we remove the no-op MODULE_ macros from non-modular files, in order to remove module.h from there as well. Overall, we get rid of about 28 instances of here. Build tested on v4.20-rc5 for allmodconfig on x86-64 and ARM-64. Paul. --- Cc: David Howells Cc: Dmitry Kasatkin Cc: James Morris Cc: John Johansen Cc: Mimi Zohar Cc: "Serge E. Hallyn" Cc: keyrings@vger.kernel.org Cc: linux-ima-devel@lists.sourceforge.net Cc: linux-integrity@vger.kernel.org Cc: linux-security-module@vger.kernel.org Paul Gortmaker (5): security: audit and remove any unnecessary uses of module.h keys: remove needless modular infrastructure from ecryptfs_format security: fs: make inode explicitly non-modular security: integrity: make evm_main explicitly non-modular security: integrity: make ima_main explicitly non-modular security/apparmor/apparmorfs.c | 2 +- security/commoncap.c | 1 - security/inode.c | 6 ++---- security/integrity/evm/evm_crypto.c | 2 +- security/integrity/evm/evm_main.c | 5 +---- security/integrity/evm/evm_posix_acl.c | 1 - security/integrity/evm/evm_secfs.c | 2 +- security/integrity/iint.c | 2 +- security/integrity/ima/ima_api.c | 1 - security/integrity/ima/ima_appraise.c | 2 +- security/integrity/ima/ima_fs.c | 2 +- security/integrity/ima/ima_init.c | 2 +- security/integrity/ima/ima_main.c | 7 +++---- security/integrity/ima/ima_policy.c | 2 +- security/integrity/ima/ima_queue.c | 1 - security/keys/encrypted-keys/ecryptfs_format.c | 5 ++--- security/keys/encrypted-keys/masterkey_trusted.c | 1 - security/keys/gc.c | 1 - security/keys/key.c | 2 +- security/keys/keyctl.c | 1 - security/keys/keyring.c | 2 +- security/keys/permission.c | 2 +- security/keys/proc.c | 1 - security/keys/process_keys.c | 1 - security/keys/request_key.c | 2 +- security/keys/request_key_auth.c | 1 - security/keys/user_defined.c | 2 +- security/security.c | 2 +- 28 files changed, 22 insertions(+), 39 deletions(-) -- 2.7.4