Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3031341pxb; Mon, 18 Oct 2021 06:58:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6pk1qz7JkkTKvgc3fIZ5Ay8plPfBRv7AnKOcdC8VC+8T+XUfRlX98JKb5pJOjOrXKkBa3 X-Received: by 2002:a05:6402:4248:: with SMTP id g8mr43825648edb.91.1634565526703; Mon, 18 Oct 2021 06:58:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634565526; cv=none; d=google.com; s=arc-20160816; b=YIeujpm+3ebdawFn1C5myNNYQkYwRuDjWIC00NW3ixeQ/jolQMh8y7AjxwT8Mxfvzf s5WeeFAW6OLA3RgvfhFLnaEAChLJFEyVIhOlKU+RFkhaeV6zHh07m0DI/BeSR5EjgEYt 8v8K1WRYYIV/s8JM4MIL4IVAtA8ZeI2Ore4krLKTmtVjOTxeleyOfrh+pv7+TUlRLHo+ +oAho1vjw05HqEQEzxy1B1m2x3jmXUbTKNEreZAwIkAPxuJAx/i27ME1KVs57z9UjeKO FXyYkAqmULNG+z9x/HXJUUoMng5mUcwFerzzyuywkwwrmu9Zx/g2SVqakJaF7ELQG3CD fHnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ck9HvkEGl7meuT7iSWpjRWbnZPojCOzMobbUZzwjyaQ=; b=bZ37eLtMQd2A+s3ZqzNduZO3npmLxeYkh5j+4JtdNpZbue08/bSjBB1Kvdvne055YV lOWb+a7Aa+d+CuIt2imUo9ux7yvOmfULlsqXpY8PgbSwCpU1i6YDYcsA61mlDlLAfvc+ E2RRaAc1zdUAfiGHlewnHVTDGPILjJhaotiDmR51cJ/FJDwccICcFmJhaj3icZnGSqUt h4L1ds6AXoyf0H4rC3DKXA069WDnONcN4K6gVeXrFnWVBk4FF2W2l69Y3zAJH8vmoihP gPChLe4k7vP4u3AVLJMZJv+YG0exU/dF4aWfU9SCnHFqMPG8ZnYk5hP1zExJgHrKmwlh 0Ucw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PiislrYd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f10si18850598eds.61.2021.10.18.06.58.22; Mon, 18 Oct 2021 06:58:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PiislrYd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234546AbhJRN4l (ORCPT + 99 others); Mon, 18 Oct 2021 09:56:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:56876 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233966AbhJRNyk (ORCPT ); Mon, 18 Oct 2021 09:54:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BB60F619F6; Mon, 18 Oct 2021 13:39:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634564386; bh=onbzt/OA7b97z/LVhERZJ34VAKYYc3A6b3rtRjO1JoU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PiislrYdWCPKtAWT6mFWz4o8YWmU+wBMKDBwDgtkzUbY08kIpDSzvm10gdTgEJMIi txsvKahkhWeSzp5Urvamx/tpsvHjJ/Ezpkwb6COG3RaSfYvNxhHmCrG+leyvDaWL60 IiUAiMKO1LFJUtMgsfQ5HWOMleykXLUNB1dSu2DE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kees Cook , Sami Tolvanen , Miroslav Benes , Arnd Bergmann , Jessica Yu Subject: [PATCH 5.14 036/151] module: fix clang CFI with MODULE_UNLOAD=n Date: Mon, 18 Oct 2021 15:23:35 +0200 Message-Id: <20211018132341.865594008@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211018132340.682786018@linuxfoundation.org> References: <20211018132340.682786018@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann commit 0d67e332e6df72f43eaa21228daa3a79e23093f3 upstream. When CONFIG_MODULE_UNLOAD is disabled, the module->exit member is not defined, causing a build failure: kernel/module.c:4493:8: error: no member named 'exit' in 'struct module' mod->exit = *exit; add an #ifdef block around this. Fixes: cf68fffb66d6 ("add support for Clang CFI") Acked-by: Kees Cook Reviewed-by: Sami Tolvanen Reviewed-by: Miroslav Benes Signed-off-by: Arnd Bergmann Signed-off-by: Jessica Yu Signed-off-by: Greg Kroah-Hartman --- kernel/module.c | 2 ++ 1 file changed, 2 insertions(+) --- a/kernel/module.c +++ b/kernel/module.c @@ -4484,8 +4484,10 @@ static void cfi_init(struct module *mod) /* Fix init/exit functions to point to the CFI jump table */ if (init) mod->init = *init; +#ifdef CONFIG_MODULE_UNLOAD if (exit) mod->exit = *exit; +#endif cfi_module_add(mod, module_addr_min); #endif