Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2213678imm; Thu, 20 Sep 2018 09:25:49 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZbCsYZY7wlTsQI7NSjObWNhEyfL5IUb74c7ovzuSDT7/d0HXGybqDwj0Y4awi/sft7rL0a X-Received: by 2002:a63:b258:: with SMTP id t24-v6mr38598562pgo.317.1537460748999; Thu, 20 Sep 2018 09:25:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537460748; cv=none; d=google.com; s=arc-20160816; b=EJ4B7XWH/KKHlwyrMfU9BUhoKtqf4hLgKKRIlVGCLtRgTNEUMtTk4M1jUz9ads3ymR cqjcXnjDVf67XxBrcDSQyIKTSGzMSKEV+I+2ymS3Zpot/QbNSeD9B04FgWjCsJspiAsF f+2Vt2YCLrt7Q4l2vkJXY9tN8OSLpxqJiLBUh0cw5CKTZRB50yvo1QiNaiCW8lAVqn0j m1uNDNyMkg2aMbHMtQ3V+FtI2gPa6F/ZF62w3S8cVk/PuOu+y46QCx58yTvY/cwZfT3N sil4Ehd2BERXFLoRSxrqiCVAk64fc6Tzu4CfcNjekuHEkXtW58kPOBa7/RREIqhE8B7r fZ6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=qxKmeptjfUa2vEoMofymSdiWJ6eFCYZf96mgiQ1zm+w=; b=Y7+RYilqllNKThBwRox+kWQNaQ8HK7zaxCHGFAncV8V+hdSifqEsSIIzj+PLLOi0Rg m9NInl31zCHNq2dWi0+Oy3RHYVKTmocUn1j1/ZM9laJtFyqXXgXfsC+BRX4XCOAhySFy yB9E6MvUE/Ocu939Jk1xbnOkUrA4fG9mBCsG/LPau2iGkMYZvohVUJysF2Mu3Yjf9Jw8 iUkpXABveradUMgwS+RB4d8QijbYpe0f0L5vC3jcSlN1BqCB9OxJ3IXaLakMV/AjZH/q 6DFliXYhISxr36PDens027iFM0ZO7mKIsOvIVUCd2g5FsJ0hP4pUEbiDQe4Me78/fwGY Wh9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=V4TgC8bV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12-v6si4737096pgi.467.2018.09.20.09.25.32; Thu, 20 Sep 2018 09:25:48 -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=@chromium.org header.s=google header.b=V4TgC8bV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732441AbeITWJJ (ORCPT + 99 others); Thu, 20 Sep 2018 18:09:09 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:46452 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387856AbeITWIH (ORCPT ); Thu, 20 Sep 2018 18:08:07 -0400 Received: by mail-pg1-f194.google.com with SMTP id b129-v6so4655953pga.13 for ; Thu, 20 Sep 2018 09:23:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qxKmeptjfUa2vEoMofymSdiWJ6eFCYZf96mgiQ1zm+w=; b=V4TgC8bV4oO1RGfvT+IaUyyihurzZ5EZzb3X4NL8Iwaqb3LUtxcqUh4oeWfeKyApZr twIA8oX20bRdkCtJOv8lleQcDx/pE/p5AE+9J4GF2I/FJXDnD5QWrb0MSorGa14zmV4r 14oi/OYEVPJN0TmWQO728xeaqTOg18JqE5JT8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qxKmeptjfUa2vEoMofymSdiWJ6eFCYZf96mgiQ1zm+w=; b=Mo/eDIPjQx/oK0xz+/Sf/UZuDHTAoqHDw4oGeoqawUKSeakmVGdJe9Rqgp726ujCEN wX3qa7HJUUk2ThDP3qsxCili3oWxOoeLuJJUOK3eiwack1mwkExR3sYRlXaqO/0DjqVG c8DVIng9wnQcgR7bDf4QTa5CFgDmdmeBbZvX5sF04V5xiCXIUIPiEOEf9dtlxZebUtdc 318A/KRc62FhJP1rPbcVIc8SKJYBM8QIdshuVPXZ6D7jVmZmOB6WUM6zQjviQwpV+7kb VAVxOU0OLZQWsNviwamJWF7VtIK+1fz7Wqlng9HsMw3qDHl4dwPRHI6zDcbt+HEemutS 7chQ== X-Gm-Message-State: APzg51Aj2sAEgoSqAsnge6wqJQfuUUgRaRZd3eJR6ZiuLpTNnxh2226/ 16BIWx59ntU/g0qv32uAIfcdXitshcE= X-Received: by 2002:a62:9541:: with SMTP id p62-v6mr42693655pfd.194.1537460632344; Thu, 20 Sep 2018 09:23:52 -0700 (PDT) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id h4-v6sm25918546pgp.13.2018.09.20.09.23.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Sep 2018 09:23:48 -0700 (PDT) From: Kees Cook To: James Morris Cc: Kees Cook , Casey Schaufler , John Johansen , Tetsuo Handa , Paul Moore , Stephen Smalley , "Schaufler, Casey" , LSM , Jonathan Corbet , linux-doc@vger.kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH security-next v2 08/26] LSM: Record LSM name in struct lsm_info Date: Thu, 20 Sep 2018 09:23:20 -0700 Message-Id: <20180920162338.21060-9-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180920162338.21060-1-keescook@chromium.org> References: <20180920162338.21060-1-keescook@chromium.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In preparation for making LSM selections outside of the LSMs, include the name of LSMs in struct lsm_info. Signed-off-by: Kees Cook --- include/linux/lsm_hooks.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h index 02ec717189f9..543636f18152 100644 --- a/include/linux/lsm_hooks.h +++ b/include/linux/lsm_hooks.h @@ -2040,16 +2040,20 @@ extern void security_add_hooks(struct security_hook_list *hooks, int count, char *lsm); struct lsm_info { + const char *name; /* Populated automatically. */ int (*init)(void); }; extern struct lsm_info __start_lsm_info[], __end_lsm_info[]; #define DEFINE_LSM(lsm) \ + static const char __lsm_name_##lsm[] __initconst \ + __aligned(1) = #lsm; \ static struct lsm_info __lsm_##lsm \ __used __section(.lsm_info.init) \ __aligned(sizeof(unsigned long)) \ = { \ + .name = __lsm_name_##lsm, \ #define END_LSM } -- 2.17.1