Received: by 10.213.65.16 with SMTP id m16csp55897imf; Sun, 11 Mar 2018 15:03:40 -0700 (PDT) X-Google-Smtp-Source: AG47ELtNC8JDrSj3ZFn00XMdSWZi6tvq3U1PG5h3bvEuSsh9vjE0dR3cQsCAbJ51PhbI4evngnPT X-Received: by 2002:a17:902:7b85:: with SMTP id w5-v6mr6027152pll.131.1520805820797; Sun, 11 Mar 2018 15:03:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520805820; cv=none; d=google.com; s=arc-20160816; b=b1stn05c9f0DLe2eZV1rBkceoH0iN7VUoNxdNtDeAFPIiyvj1No+fgfve0+dGdTdGf Uhyzqb+2H8OPYrcr4JoyG0GgGym62N+COWZ3xlcJFDn1CaP6uLtHAtzD7vqZOObFt0uT Wd8Vr54k0cb+P8AheHRK/KwCqjoL/kNfFe1/18rozGKiPYNgif1AYbO84x0bxkjn2ZTo 3sBLaTW6o8P/2ufXxuj0kQp3BQStPIKUzTT8Wpry+0NkkKd5eMz2b7nTOystCkL4cyMk E2Sbydz93OSc7oaSWQCboa6DRMSkwxHOd2YnxhbaIxJgO6jdlbzGFBdjSAQMesiz1O7Q decA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:to:from:subject :arc-authentication-results; bh=O3YeLTXqmaA/bGJn3O8JFJi8e8hOUbN4fqwqWtgPVXc=; b=FFKI1vmzC/KBm6NtG2dO2nqCcxi4Mq+8w+p3IU/dAbcN6eyaZwGq2n6EmMEhSLhGj+ QjIbII+62IoHlnOc3XvTFJv74gLrZ1KW7CXCmZzZmQyu9nbDDVzIxzWIGXX6d7gyu8BC gIHnHhLGL+Y/YGW+kCaqJQ/j8HSXn0YYcd6cIzBxlwJsJ6VAo5YUeVkONW1S8VicJraC FBhaYELjsKs45+/4zP4rY4BFA7pJ6ZvRsmfGvog4p4AiMty2tmzaN7NWaVw3telREU6L LW3Zqtqte2UrntKh1H2N33sTymJj2LiN13zse9juXWWdrcxaTLbZDoXZD6lTHgcp9M0G C2gg== 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 p7si4027229pgq.51.2018.03.11.15.03.13; Sun, 11 Mar 2018 15:03:40 -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; 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 S932473AbeCKWBa (ORCPT + 99 others); Sun, 11 Mar 2018 18:01:30 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:33914 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932426AbeCKWB2 (ORCPT ); Sun, 11 Mar 2018 18:01:28 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2BLxSYu037333 for ; Sun, 11 Mar 2018 18:01:28 -0400 Received: from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gn2xad88a-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Sun, 11 Mar 2018 18:01:27 -0400 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 11 Mar 2018 22:01:24 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sun, 11 Mar 2018 22:01:20 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2BM1KQp57213006; Sun, 11 Mar 2018 22:01:20 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 59A11A4055; Sun, 11 Mar 2018 21:54:12 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7ADF0A4053; Sun, 11 Mar 2018 21:54:11 +0000 (GMT) Received: from localhost.localdomain (unknown [9.80.82.225]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Sun, 11 Mar 2018 21:54:11 +0000 (GMT) Subject: Re: [PATCH 1/2] security: evm: Move evm_hmac and evm_hash from evm_main.c to evm_crypto.c From: Mimi Zohar To: =?ISO-8859-1?Q?Hern=E1n?= Gonzalez , jmorris@namei.org, serge@hallyn.com, linux-integrity@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sun, 11 Mar 2018 18:01:18 -0400 In-Reply-To: <1519769820-20365-1-git-send-email-hernan@vanguardiasur.com.ar> References: <1519769820-20365-1-git-send-email-hernan@vanguardiasur.com.ar> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 18031122-0040-0000-0000-0000041E11FA X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18031122-0041-0000-0000-000026213679 Message-Id: <1520805678.3547.8.camel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-11_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803110281 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2018-02-27 at 19:16 -0300, Hernán Gonzalez wrote: > Note: This is compile only tested. > This variable was not used where it was defined, there was no point in > declaring it there as extern, thus it got moved and constified saving up 2 > bytes. > > Function old new delta > init_desc 273 271 -2 > Total: Before=2112094, After=2112092, chg -0.00% > > Signed-off-by: Hernán Gonzalez Thanks, both patches have been applied. Mimi > --- > security/integrity/evm/evm.h | 2 -- > security/integrity/evm/evm_crypto.c | 3 +++ > security/integrity/evm/evm_main.c | 2 -- > 3 files changed, 3 insertions(+), 4 deletions(-) > > diff --git a/security/integrity/evm/evm.h b/security/integrity/evm/evm.h > index 0482539..45c4a89 100644 > --- a/security/integrity/evm/evm.h > +++ b/security/integrity/evm/evm.h > @@ -31,8 +31,6 @@ > EVM_ALLOW_METADATA_WRITES) > > extern int evm_initialized; > -extern char *evm_hmac; > -extern char *evm_hash; > > #define EVM_ATTR_FSUUID 0x0001 > > diff --git a/security/integrity/evm/evm_crypto.c b/security/integrity/evm/evm_crypto.c > index 691f3e0..fdde9cb 100644 > --- a/security/integrity/evm/evm_crypto.c > +++ b/security/integrity/evm/evm_crypto.c > @@ -37,6 +37,9 @@ static DEFINE_MUTEX(mutex); > > static unsigned long evm_set_key_flags; > > +char * const evm_hmac = "hmac(sha1)"; > +char * const evm_hash = "sha1"; > + > /** > * evm_set_key() - set EVM HMAC key from the kernel > * @key: pointer to a buffer with the key data > diff --git a/security/integrity/evm/evm_main.c b/security/integrity/evm/evm_main.c > index a8d5028..826926d 100644 > --- a/security/integrity/evm/evm_main.c > +++ b/security/integrity/evm/evm_main.c > @@ -33,8 +33,6 @@ int evm_initialized; > static char *integrity_status_msg[] = { > "pass", "pass_immutable", "fail", "no_label", "no_xattrs", "unknown" > }; > -char *evm_hmac = "hmac(sha1)"; > -char *evm_hash = "sha1"; > int evm_hmac_attrs; > > char *evm_config_xattrnames[] = {