Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp904129imu; Fri, 16 Nov 2018 12:10:21 -0800 (PST) X-Google-Smtp-Source: AJdET5cwbRfTpyiHHmtixha+9GiRKu//w88xqDaNoFrlDsjcmNtrdnTb38+4H00VOXD61RtqtIdH X-Received: by 2002:a62:6241:: with SMTP id w62-v6mr12488894pfb.69.1542399021447; Fri, 16 Nov 2018 12:10:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542399021; cv=none; d=google.com; s=arc-20160816; b=zWQNARmHKAR0LlyzV8J3FXU81NsofuPzUXQQrd49FP9MXgZTmrxvcQEzPMY6WA1law RGW79OVd4CpUBaZF/25a6ZioQhPl2wINkWKBiHN1qmkCJ1rRMuSlgY+G/4z8cy72IQN1 HbxBE9urFpjbGMl74YGazlYZDbwX0rNM0zjVqTalsLIH56QpdshF1rDGH0jU/Hhh13QT +L3DmuHdGLIJAiM6Y2K5yB1G5Jdaw6keQMpXf2eenUzN+lNPPurl8o3oZFCaPH6ge3PW a2u8An1ky10crrOofpu08zTMC8FmS54jcuZceYXKmKBgtMU7kI5y/s536u6l7I8iq/HZ f4rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from; bh=VMqQH+PVakLgjXHLNdXsX6asiCOgPFeVATS7aM2lOMU=; b=MIkvwGkjORbNlNb2qDYsaM5lTtJGH2pGRfH/mPLlER9t1UjPb3HixQsmqsYodhxbqs ciGZwOWOrNCws6s0UNql0q/AZJlCoe5+fnh8ozaaUMKGs4EQjnf5S/5igiGfDO7KhcAm Xk5nZ2mBYSyuz7qrvscAx6z5eFunQH9g/3cQ+SK5nqMUFAV6m+RSgdstk3+ORcwCM6KV O87QE/mK03YOloEd+4cFVGj+SBBc+8pM/szdyoQKJhELyJfnZ1PrTkIukMmGvNhlqOYp yujmhucvtn/Pqkm90xwstNXxj7Qk4LkDR9Th3cTSI4oTSFQg1kVZyUmphZ1muABoy4bc VUCQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g22si17311873pfj.222.2018.11.16.12.10.06; Fri, 16 Nov 2018 12:10:21 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729764AbeKQGW5 (ORCPT + 99 others); Sat, 17 Nov 2018 01:22:57 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:43568 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729643AbeKQGWz (ORCPT ); Sat, 17 Nov 2018 01:22:55 -0500 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wAGK90YD043242 for ; Fri, 16 Nov 2018 15:09:06 -0500 Received: from e13.ny.us.ibm.com (e13.ny.us.ibm.com [129.33.205.203]) by mx0b-001b2d01.pphosted.com with ESMTP id 2nt20jebgy-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 16 Nov 2018 15:09:05 -0500 Received: from localhost by e13.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 16 Nov 2018 20:09:05 -0000 Received: from b01cxnp23034.gho.pok.ibm.com (9.57.198.29) by e13.ny.us.ibm.com (146.89.104.200) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 16 Nov 2018 20:08:59 -0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wAGK8wtx29818972 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 16 Nov 2018 20:08:58 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 81BD4AC05E; Fri, 16 Nov 2018 20:08:58 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 72AAEAC060; Fri, 16 Nov 2018 20:08:54 +0000 (GMT) Received: from morokweng.localdomain.com (unknown [9.80.224.199]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 16 Nov 2018 20:08:54 +0000 (GMT) From: Thiago Jung Bauermann To: linux-integrity@vger.kernel.org Cc: linux-security-module@vger.kernel.org, keyrings@vger.kernel.org, linux-crypto@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Mimi Zohar , Dmitry Kasatkin , James Morris , "Serge E. Hallyn" , David Howells , David Woodhouse , Jessica Yu , Herbert Xu , "David S. Miller" , Jonathan Corbet , "AKASHI, Takahiro" , Thiago Jung Bauermann Subject: [PATCH v8 09/14] ima: Export func_tokens Date: Fri, 16 Nov 2018 18:07:07 -0200 X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181116200712.14154-1-bauerman@linux.ibm.com> References: <20181116200712.14154-1-bauerman@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18111620-0064-0000-0000-00000375640D X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010063; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000270; SDB=6.01118417; UDB=6.00577118; IPR=6.00898526; MB=3.00024196; MTD=3.00000008; XFM=3.00000015; UTC=2018-11-16 20:09:04 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18111620-0065-0000-0000-00003B5B7D68 Message-Id: <20181116200712.14154-10-bauerman@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-11-16_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811160179 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ima_read_modsig() will need it so that it can show an error message. Signed-off-by: Thiago Jung Bauermann --- security/integrity/ima/ima.h | 2 ++ security/integrity/ima/ima_policy.c | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/security/integrity/ima/ima.h b/security/integrity/ima/ima.h index e4f72b30cb28..f0bc2a182cbf 100644 --- a/security/integrity/ima/ima.h +++ b/security/integrity/ima/ima.h @@ -195,6 +195,8 @@ enum ima_hooks { __ima_hooks(__ima_hook_enumify) }; +extern const char *const func_tokens[]; + /* LIM API function definitions */ int ima_get_action(struct inode *inode, const struct cred *cred, u32 secid, int mask, enum ima_hooks func, int *pcr); diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c index b20770704b6c..fd31e42c2bad 100644 --- a/security/integrity/ima/ima_policy.c +++ b/security/integrity/ima/ima_policy.c @@ -1136,6 +1136,12 @@ void ima_delete_rules(void) } } +#define __ima_hook_stringify(str) (#str), + +const char *const func_tokens[] = { + __ima_hooks(__ima_hook_stringify) +}; + #ifdef CONFIG_IMA_READ_POLICY enum { mask_exec = 0, mask_write, mask_read, mask_append @@ -1148,12 +1154,6 @@ static const char *const mask_tokens[] = { "MAY_APPEND" }; -#define __ima_hook_stringify(str) (#str), - -static const char *const func_tokens[] = { - __ima_hooks(__ima_hook_stringify) -}; - void *ima_policy_start(struct seq_file *m, loff_t *pos) { loff_t l = *pos;