Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8989687ybi; Tue, 23 Jul 2019 19:34:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqx+p/ils6stfoVHhJP17VUfG0texmjLdiKLaVgqIq28Bi4cyrX09lbwyFO4odtRM/kbMDEk X-Received: by 2002:a63:24c1:: with SMTP id k184mr80953926pgk.120.1563935664037; Tue, 23 Jul 2019 19:34:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563935664; cv=none; d=google.com; s=arc-20160816; b=uTyhvrulCsiLSRXI+xS9NoJtEL2sE0N4SoLbdNPVKA4ARgM/FZuMJTANy54CPmg0WP mWWo3u4saigeTP2shwfglfnTArghX0rZ0Hs1Y5MvrmLyNHXap8yx0nM8O36+QsnVoKPJ 7SKrjDn3tb32OEvtbgPgAIkYsf0YT1P5t5fuOV4fkBMjx31mva70kTc3cOgvME3qN87U 4vksu4Vlk8KVRS5GB0sDmpefhjSekFZm5jMuo+OCdBVmk1+RL7FRoo3HwUUk8AM2fHR0 YUVOlh5vLgdQlGGTBSllFzdr9Xfoxvd5cmGoGIm357s1ZCrJIFOSgTBDpsoc+LtvPfmS SrCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:mime-version:date:in-reply-to :subject:cc:to:from:user-agent:references; bh=p54yOqtPP9h8ixkF3tYHFdzdy8LbOSbvlN0kKG9QBoE=; b=hJ0gjjSY985YC/bYIc8koAOFX5hSJiGmLj4Czh07gD6K4N0b/b7wfDz6TReWur5Jng PVtbKmBBx2ZDlSGxRX2WN+IXbK+RgAMqrwOjBn5ENK8ksC1IMihpJOtAyv8iwwj4M77Z +HC/3noW5N0p6p+FyHYn6rZuaWIHdv5UzlJI1YB40Cjc0MnIOufGtGe+hhPol63598Yj xovZY/YhkWVPPG2qdwATpCrvT4A6/ND5Iay0xoe+rl2lBqKC8/6OobXm10rVDSLkNr8i A5pGCD4tK7hcS5eRkUAztyUQmBpxKYqqR+XmIPLEJSHrYNenKpU/NEWNwOo0VdzB8ve9 utvQ== 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 q14si38422434pjp.78.2019.07.23.19.34.08; Tue, 23 Jul 2019 19:34:24 -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 S1732092AbfGWWju (ORCPT + 99 others); Tue, 23 Jul 2019 18:39:50 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:26384 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729061AbfGWWjt (ORCPT ); Tue, 23 Jul 2019 18:39:49 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x6NMatwK145528 for ; Tue, 23 Jul 2019 18:39:48 -0400 Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx0a-001b2d01.pphosted.com with ESMTP id 2tx92v4pmr-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 23 Jul 2019 18:39:48 -0400 Received: from localhost by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 23 Jul 2019 23:39:47 +0100 Received: from b03cxnp08025.gho.boulder.ibm.com (9.17.130.17) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 23 Jul 2019 23:39:41 +0100 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x6NMdemE46465390 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 23 Jul 2019 22:39:40 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0D62C7805F; Tue, 23 Jul 2019 22:39:40 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3DDBF7805C; Tue, 23 Jul 2019 22:39:32 +0000 (GMT) Received: from morokweng.localdomain (unknown [9.85.148.251]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTPS; Tue, 23 Jul 2019 22:39:31 +0000 (GMT) References: <20190628021934.4260-1-bauerman@linux.ibm.com> <20190628021934.4260-2-bauerman@linux.ibm.com> <20190701144752.GC25484@linux-8ccs> <87lfxel2q6.fsf@morokweng.localdomain> <20190704125427.31146026@laptop-ibm> <874l41ocf5.fsf@morokweng.localdomain> <20190705150000.372345b0@laptop-ibm> User-agent: mu4e 1.2.0; emacs 26.2 From: Thiago Jung Bauermann To: Philipp Rudo Cc: Jessica Yu , linux-integrity@vger.kernel.org, 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 , Herbert Xu , "David S. Miller" , Jonathan Corbet , "AKASHI\, Takahiro" , Heiko Carstens , linux-s390@vger.kernel.org Subject: Re: [PATCH v12 01/11] MODSIGN: Export module signature definitions In-reply-to: <20190705150000.372345b0@laptop-ibm> Date: Tue, 23 Jul 2019 19:39:27 -0300 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 x-cbid: 19072322-0016-0000-0000-000009D393BA X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011484; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000287; SDB=6.01236487; UDB=6.00651706; IPR=6.01017844; MB=3.00027860; MTD=3.00000008; XFM=3.00000015; UTC=2019-07-23 22:39:46 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19072322-0017-0000-0000-0000442346CA Message-Id: <8736iw9y00.fsf@morokweng.localdomain> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-07-23_09:,, 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 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1907230230 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Philipp, Philipp Rudo writes: > Hi Thiago, > > On Thu, 04 Jul 2019 15:57:34 -0300 > Thiago Jung Bauermann wrote: > >> Hello Philipp, >> >> Philipp Rudo writes: >> >> > Hi Thiago, >> > >> > >> > On Thu, 04 Jul 2019 03:42:57 -0300 >> > Thiago Jung Bauermann wrote: >> > >> >> Jessica Yu writes: >> >> >> >> > +++ Thiago Jung Bauermann [27/06/19 23:19 -0300]: >> >> >>IMA will use the module_signature format for append signatures, so export >> >> >>the relevant definitions and factor out the code which verifies that the >> >> >>appended signature trailer is valid. >> >> >> >> >> >>Also, create a CONFIG_MODULE_SIG_FORMAT option so that IMA can select it >> >> >>and be able to use mod_check_sig() without having to depend on either >> >> >>CONFIG_MODULE_SIG or CONFIG_MODULES. >> >> >> >> >> >>Signed-off-by: Thiago Jung Bauermann >> >> >>Reviewed-by: Mimi Zohar >> >> >>Cc: Jessica Yu >> >> >>--- >> >> >> include/linux/module.h | 3 -- >> >> >> include/linux/module_signature.h | 44 +++++++++++++++++++++++++ >> >> >> init/Kconfig | 6 +++- >> >> >> kernel/Makefile | 1 + >> >> >> kernel/module.c | 1 + >> >> >> kernel/module_signature.c | 46 ++++++++++++++++++++++++++ >> >> >> kernel/module_signing.c | 56 +++++--------------------------- >> >> >> scripts/Makefile | 2 +- >> >> >> 8 files changed, 106 insertions(+), 53 deletions(-) >> >> >> >> >> >>diff --git a/include/linux/module.h b/include/linux/module.h >> >> >>index 188998d3dca9..aa56f531cf1e 100644 >> >> >>--- a/include/linux/module.h >> >> >>+++ b/include/linux/module.h >> >> >>@@ -25,9 +25,6 @@ >> >> >> #include >> >> >> #include >> >> >> >> >> >>-/* In stripped ARM and x86-64 modules, ~ is surprisingly rare. */ >> >> >>-#define MODULE_SIG_STRING "~Module signature appended~\n" >> >> >>- >> >> > >> >> > Hi Thiago, apologies for the delay. >> >> >> >> Hello Jessica, thanks for reviewing the patch! >> >> >> >> > It looks like arch/s390/kernel/machine_kexec_file.c also relies on >> >> > MODULE_SIG_STRING being defined, so module_signature.h will need to be >> >> > included there too, otherwise we'll run into a compilation error. >> >> >> >> Indeed. Thanks for spotting that. The patch below fixes it. It's >> >> identical to the previous version except for the changes in >> >> arch/s390/kernel/machine_kexec_file.c and their description in the >> >> commit message. I'm also copying some s390 people in this email. >> > >> > to me the s390 part looks good but for one minor nit. >> >> Thanks for the prompt review! >> >> > In arch/s390/Kconfig KEXEC_VERIFY_SIG currently depends on >> > SYSTEM_DATA_VERIFICATION. I'd prefer when you update this to the new >> > MODULE_SIG_FORMAT. It shouldn't make any difference right now, as we don't >> > use mod_check_sig in our code path. But it could cause problems in the future, >> > when more code might be shared. >> >> Makes sense. Here is the updated patch with the Kconfig change. >> > > The patch looks good now. Thanks! Can I add your Reviewed-by? -- Thiago Jung Bauermann IBM Linux Technology Center