From patchwork Tue Aug 23 16:56:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thiago Jung Bauermann X-Patchwork-Id: 9296155 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BCB7D607D0 for ; Tue, 23 Aug 2016 18:28:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B1A8C287BE for ; Tue, 23 Aug 2016 18:28:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A636728ABC; Tue, 23 Aug 2016 18:28:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A566287BE for ; Tue, 23 Aug 2016 18:28:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753048AbcHWS2U (ORCPT ); Tue, 23 Aug 2016 14:28:20 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:48924 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752389AbcHWS2T (ORCPT ); Tue, 23 Aug 2016 14:28:19 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u7NGtLul089936 for ; Tue, 23 Aug 2016 12:57:01 -0400 Received: from e24smtp05.br.ibm.com (e24smtp05.br.ibm.com [32.104.18.26]) by mx0a-001b2d01.pphosted.com with ESMTP id 250p48rgr3-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 23 Aug 2016 12:57:01 -0400 Received: from localhost by e24smtp05.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 23 Aug 2016 13:56:59 -0300 Received: from d24dlp02.br.ibm.com (9.18.248.206) by e24smtp05.br.ibm.com (10.172.0.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 23 Aug 2016 13:56:56 -0300 X-IBM-Helo: d24dlp02.br.ibm.com X-IBM-MailFrom: bauerman@linux.vnet.ibm.com X-IBM-RcptTo: linux-security-module@vger.kernel.org Received: from d24relay01.br.ibm.com (d24relay01.br.ibm.com [9.8.31.16]) by d24dlp02.br.ibm.com (Postfix) with ESMTP id AAA691DC0051 for ; Tue, 23 Aug 2016 12:56:46 -0400 (EDT) Received: from d24av05.br.ibm.com (d24av05.br.ibm.com [9.18.232.44]) by d24relay01.br.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u7NGuua44030680 for ; Tue, 23 Aug 2016 13:56:56 -0300 Received: from d24av05.br.ibm.com (localhost [127.0.0.1]) by d24av05.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u7NGutTu018128 for ; Tue, 23 Aug 2016 13:56:55 -0300 Received: from hactar.localnet ([9.78.128.211]) by d24av05.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u7NGusWH018106; Tue, 23 Aug 2016 13:56:55 -0300 From: Thiago Jung Bauermann To: kbuild test robot Cc: kbuild-all@01.org, linux-ima-devel@lists.sourceforge.net, linux-security-module@vger.kernel.org, Mimi Zohar Subject: Re: [integrity:next-restore-kexec 5/9] kernel/kexec_file.c:206:2: error: implicit declaration of function 'ima_add_kexec_buffer' Date: Tue, 23 Aug 2016 13:56:54 -0300 User-Agent: KMail/4.14.3 (Linux/3.13.0-93-generic; KDE/4.14.13; x86_64; ; ) In-Reply-To: <201608232253.OLsTdxuq%fengguang.wu@intel.com> References: <201608232253.OLsTdxuq%fengguang.wu@intel.com> MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16082316-0032-0000-0000-000002790631 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16082316-0033-0000-0000-00000EC1EA4D Message-Id: <1548969.9JfI2IRN2U@hactar> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-08-23_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1608230168 Sender: owner-linux-security-module@vger.kernel.org Precedence: bulk List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Am Dienstag, 23 August 2016, 22:20:55 schrieb kbuild test robot: > tree: > https://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity.git > next-restore-kexec head: 62bc4b565254de4796a0835f6f67569eb4835f9f > commit: 4733b1cd5da19fc80df1c1a91f1b1f2a94e70938 [5/9] ima: on soft > reboot, save the measurement list config: x86_64-randconfig-x015-201634 > (attached as .config) > compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705 > reproduce: > git checkout 4733b1cd5da19fc80df1c1a91f1b1f2a94e70938 > # save the attached .config to linux build tree > make ARCH=x86_64 > > All errors (new ones prefixed by >>): > > kernel/kexec_file.c: In function 'kimage_file_prepare_segments': > >> kernel/kexec_file.c:206:2: error: implicit declaration of function > >> 'ima_add_kexec_buffer' [-Werror=implicit-function-declaration] > ima_add_kexec_buffer(image); > ^~~~~~~~~~~~~~~~~~~~ This happens with CONFIG_IMA=n and CONFIG_KEXEC_FILE=y. You can fix it with the following change in the patch "ima: on soft reboot, save the measurement list": Declare stub ima_add_kexec_buffer and stub struct kimage when CONFIG_IMA=n or CONFIG_IMA_KEXEC=n. This patch also incorporates the change to fix "[integrity:next-restore-kexec 5/9] include/linux/ima.h:30:48: warning: 'struct kimage' declared inside parameter list" that I just sent. diff --git a/include/linux/ima.h b/include/linux/ima.h index 6a2450ca13f1..e3d617526bed 100644 --- a/include/linux/ima.h +++ b/include/linux/ima.h @@ -26,10 +26,6 @@ extern void ima_post_path_mknod(struct dentry *dentry); #ifdef CONFIG_IMA_KEXEC extern void ima_add_kexec_buffer(struct kimage *image); -#else -static inline void ima_add_kexec_buffer(struct kimage *image) -{ -} #endif #else @@ -71,6 +67,14 @@ static inline void ima_post_path_mknod(struct dentry *dentry) #endif /* CONFIG_IMA */ +#if !defined(CONFIG_IMA) || !defined(CONFIG_IMA_KEXEC) +struct kimage; + +static inline void ima_add_kexec_buffer(struct kimage *image) +{ +} +#endif + #ifdef CONFIG_IMA_APPRAISE extern void ima_inode_post_setattr(struct dentry *dentry); extern int ima_inode_setxattr(struct dentry *dentry, const char *xattr_name,