Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2430130imm; Sat, 15 Sep 2018 17:32:51 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda3eT2s+RQ7FEzt5LC1/iFTORv4iBQKVn3IX5O+D9u16Anr4+css1s/sLlYWWuaEhmAFqW6 X-Received: by 2002:a17:902:204:: with SMTP id 4-v6mr14736455plc.281.1537057971036; Sat, 15 Sep 2018 17:32:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537057971; cv=none; d=google.com; s=arc-20160816; b=iMuwCx+KVAS+O+SyYNqKcSX2VQEWGIH1yokHcQdEoxRXPYsZe+p8Owo14GuUssGIQc VFyyZryGeEnRv0DSUIMZomugSBrnKrs6dvyb/n631D6I5Xs1i8XdrdsB89idicddf5xp GA8j6f3EO37FCe3rpBFWg9XiRrVuy7gQ2cwtS3NsTCCorUjixctWI2/B2o5RTSqEDYpq o1M/LklJXUN0gmtDiSl5NKxycVCIM09fxjppmJixef+iy4UFyhD1QP1sWs67pQe9/v4T 1gu952kEE3wTmNJOZ/M2TXhyjbWd8cZif1ywQK5s5mJTs0As1X0bvSowS1AHl05ITaw8 oVUg== 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=ooUL0UzptcnBdxX1R2VjgwpCyouyAdeHqleI/GcdB9g=; b=fJ6bcxtP2JEcW7MTeRypPU17lDMlvAGbjyMP0sltky3m6rUouGG6jd0EuMyLFHArMY 41+rT6z9ZMAmvxgkSpqdhvSCsvUaDyl8pt2qBj4ZwZJNOKEUprKL47TEQIsei/NGGbym 64DDmcx16EGYeIK1n3BE7cJSpdjExWIHlFzXQZt5W9irpBBpMzzMo6t5WUFgi81gRvtQ qZz839/sBSqh+Sl+p2i+KSPry8oUsAOwjk/wLKv3nzooknarKOFIIayNgUzB9pQVfvUO C5oqiJcJwgxsW9aRp6qIbYHLQXSHRFtim6Yt0a3irCQ0m2ioyEXvVnyqXcW28W02FUSC u8/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Tf1ZTMBF; 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 a6-v6si10402216plz.227.2018.09.15.17.32.36; Sat, 15 Sep 2018 17:32:51 -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=Tf1ZTMBF; 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 S1728248AbeIPFwI (ORCPT + 99 others); Sun, 16 Sep 2018 01:52:08 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:36744 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728155AbeIPFwI (ORCPT ); Sun, 16 Sep 2018 01:52:08 -0400 Received: by mail-pg1-f194.google.com with SMTP id d1-v6so6029306pgo.3 for ; Sat, 15 Sep 2018 17:31:12 -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=ooUL0UzptcnBdxX1R2VjgwpCyouyAdeHqleI/GcdB9g=; b=Tf1ZTMBFd4yehERG+eoHASmfpTpolP9B/tda2lPrYfegaTZLOjGeleIVQqzOcdCQ7O R9OCWMjbGJG3qdpvG+Gf0um+sI7Ww0s1r9ndzWzRp3DKLxmVasG7UVsUKPccLh8+hK9u 0+EpF03zYK9cWIdJDc9vsHLQn1qAJdJ/Ck61k= 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=ooUL0UzptcnBdxX1R2VjgwpCyouyAdeHqleI/GcdB9g=; b=qvO+WLCQjF68gASk/id8fPr3RHxrHcG3WBFJnnKx8xR/opbgV/K1tIXVjH6itz/FyF 22ScDLfw4Bkkoah+C3u4X/7lFf2P3ZnqEGxXPxqfOOF5CKC7bJ/OlApXjV4wphI5LCcs KxZVvte6vmvK+m+wA67t7uX2rBPZUcZI5m/0dWKXHsCbbIjRWbklR962M0YtVY/JOEGT qzXFMO2p13kP97qALKnudwGhhVRUn8hqxqjZYRMTr3HkgLzjXd+wCgl98ogupXFQWkD7 lXQWZyuz04YsLXT9cUGbS9DQm99ubulm7uW3En2pQiZS48MR83E1c35hl+l5kCLNiVRy xXgQ== X-Gm-Message-State: APzg51Asq5+lHz8uOMEjSfUVrPkp2vV5tnekoOBS5jNHtf3leOkFMQ1O 4twQGzjvgIU7TGLhZe352vI9Fg== X-Received: by 2002:a62:d544:: with SMTP id d65-v6mr19236393pfg.107.1537057872047; Sat, 15 Sep 2018 17:31:12 -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 j22-v6sm13651495pfh.45.2018.09.15.17.31.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Sep 2018 17:31:08 -0700 (PDT) From: Kees Cook To: James Morris Cc: Kees Cook , Casey Schaufler , John Johansen , Tetsuo Handa , Paul Moore , Stephen Smalley , "Schaufler, Casey" , LSM , LKLM Subject: [PATCH 09/18] LSM: Record LSM name in struct lsm_info Date: Sat, 15 Sep 2018 17:30:50 -0700 Message-Id: <20180916003059.1046-10-keescook@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180916003059.1046-1-keescook@chromium.org> References: <20180916003059.1046-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 ec3419b9b16f..a7833193e9e9 100644 --- a/include/linux/lsm_hooks.h +++ b/include/linux/lsm_hooks.h @@ -2045,6 +2045,7 @@ enum lsm_type { }; struct lsm_info { + const char *name; /* Populated automatically. */ enum lsm_type type; /* Optional: default is LSM_TYPE_EXCLUSIVE */ int (*init)(void); }; @@ -2052,10 +2053,13 @@ struct lsm_info { 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 const struct lsm_info __lsm_##lsm \ __used __section(.lsm_info.init) \ __aligned(sizeof(unsigned long)) \ = { \ + .name = __lsm_name_##lsm, \ #define END_LSM } -- 2.17.1