From patchwork Thu Apr 12 02:25:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sargun Dhillon X-Patchwork-Id: 10337743 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 350D960153 for ; Thu, 12 Apr 2018 02:25:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 21F6528620 for ; Thu, 12 Apr 2018 02:25:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1668928641; Thu, 12 Apr 2018 02:25:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 058D428620 for ; Thu, 12 Apr 2018 02:25:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751870AbeDLCZn (ORCPT ); Wed, 11 Apr 2018 22:25:43 -0400 Received: from mail-io0-f196.google.com ([209.85.223.196]:42455 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751777AbeDLCZm (ORCPT ); Wed, 11 Apr 2018 22:25:42 -0400 Received: by mail-io0-f196.google.com with SMTP id d5so4628817iob.9 for ; Wed, 11 Apr 2018 19:25:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sargun.me; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=K0ZUu3mu/7geZaS0WEMH2mTtp+USp9czYBdL8W6ijnc=; b=ZPJaM3izqZJIQdlGWoH708K02b8XrnrPLlxBQY3RGegehh2WcUS9f+ExrE8C73h0Uj MJDuN/PoHlnUR7GKxIUdeEPH9BvQ4kPPatw7RHnN3w4UU2RY35KGrNwSSXwCEIrxv6Tx prCB+Eo0KUrX7Eh3poIfYwqdnHI25aCtFnYKM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=K0ZUu3mu/7geZaS0WEMH2mTtp+USp9czYBdL8W6ijnc=; b=rpfSKGHBeVUgHHpqRZGUT991bUFvE6hJ0fuwY+U1E1uk1sIVBJlXjAfYRTsuB0lWF/ yS7yNlIfOH5xF3c87z87x8wN29S5Jip1tXGGmRXLN94ScgMkHZzZ0cw8fuYMOoLuhtFg mdh/g2WQW6P8NVUTNKawMCJn+kg8zLHyL2JkGERsxZsI1C88eOd28mfMTexk1Alq8e7F gDfL6h7gsn86YwyKSl3hv3ToX83iIdEVVgqu6uNAvcz0XqvEpTUUdbj2Q+uI7sdDj+VK 4xJ5yT4yjoxAoLHAaWPxdSdXFO3kvQ+BV7PlHC7U29CDcsTWwpRKnpYa6La46J6mKfTi zsxA== X-Gm-Message-State: ALQs6tC8TF1sBNwTYBrC+iJ4Zz7Ftwdw4qIF6yH6YXy406nc1Mn56wYD biX42ukVLNrIpPQ0hi6utmQBfmAr+SE= X-Google-Smtp-Source: AIpwx48xkOoYtx2H8JIci/anKxF6/s9oAaRpgKNWIQWVjYCh4em0l0kyYrglY8VwhooOpaWiQuxtog== X-Received: by 10.107.36.136 with SMTP id k130mr6814885iok.270.1523499941739; Wed, 11 Apr 2018 19:25:41 -0700 (PDT) Received: from ircssh-2.c.rugged-nimbus-611.internal (80.60.198.104.bc.googleusercontent.com. [104.198.60.80]) by smtp.gmail.com with ESMTPSA id 22-v6sm1397876itj.16.2018.04.11.19.25.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Apr 2018 19:25:41 -0700 (PDT) Date: Thu, 12 Apr 2018 02:25:39 +0000 From: Sargun Dhillon To: linux-security-module@vger.kernel.org Cc: casey@schaufler-ca.com, jmorris@namei.org Subject: [PATCH] security: Remove unused field from security_hook_list Message-ID: <20180412022536.GA8919@ircssh-2.c.rugged-nimbus-611.internal> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP It appears like char * lsm on struct security_hook_list is unused. Even since its inception: https://patchwork.kernel.org/patch/9525051/ it hasn't been read, only written to. This removes that. Signed-off-by: Sargun Dhillon --- include/linux/lsm_hooks.h | 1 - security/security.c | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h index ac491137b10a..ea07e9cdfee0 100644 --- a/include/linux/lsm_hooks.h +++ b/include/linux/lsm_hooks.h @@ -1966,7 +1966,6 @@ struct security_hook_list { struct hlist_node list; struct hlist_head *head; union security_list_options hook; - char *lsm; } __randomize_layout; /* diff --git a/security/security.c b/security/security.c index dd246a38b3f0..b0a34961d0a3 100644 --- a/security/security.c +++ b/security/security.c @@ -161,10 +161,8 @@ void __init security_add_hooks(struct security_hook_list *hooks, int count, { int i; - for (i = 0; i < count; i++) { - hooks[i].lsm = lsm; + for (i = 0; i < count; i++) hlist_add_tail_rcu(&hooks[i].list, hooks[i].head); - } if (lsm_append(lsm, &lsm_names) < 0) panic("%s - Cannot get early memory.\n", __func__); }