From patchwork Mon Jul 24 10:01:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenyu Liu X-Patchwork-Id: 13324321 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 068C4C001B0 for ; Mon, 24 Jul 2023 10:29:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231490AbjGXK3k (ORCPT ); Mon, 24 Jul 2023 06:29:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231550AbjGXK32 (ORCPT ); Mon, 24 Jul 2023 06:29:28 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1759910D8; Mon, 24 Jul 2023 03:26:18 -0700 (PDT) Received: from kwepemm600006.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4R8bGS2scxzHqdf; Mon, 24 Jul 2023 17:58:56 +0800 (CST) Received: from [10.174.177.30] (10.174.177.30) by kwepemm600006.china.huawei.com (7.193.23.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 24 Jul 2023 18:01:28 +0800 Message-ID: <3252d7b3-0d78-808d-8d36-a5b3f969e15d@huawei.com> Date: Mon, 24 Jul 2023 18:01:27 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 To: , , CC: , , , , , , , From: Wenyu Liu Subject: [PATCH v2] kexec_lock: Replace kexec_mutex() by kexec_lock() in two comments X-Originating-IP: [10.174.177.30] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600006.china.huawei.com (7.193.23.105) X-CFilter-Loop: Reflected Precedence: bulk List-ID: kexec_mutex is replaced by an atomic variable in 05c6257433b (panic, kexec: make __crash_kexec() NMI safe). But there are still two comments that for kexec_add_buffer() and ima_add_kexec_buffer() using kexec_mutex, replace them by kexec_lock. Signed-off-by: Wenyu Liu Acked-by: Baoquan He Acked-by: Paul Menzel --- v1 -> v2 - fixed some mistakes in the submission information kernel/kexec_file.c | 2 +- security/integrity/ima/ima_kexec.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.33.0 diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c index 881ba0d1714c..b5bbb2fe0668 100644 --- a/kernel/kexec_file.c +++ b/kernel/kexec_file.c @@ -624,7 +624,7 @@ int kexec_locate_mem_hole(struct kexec_buf *kbuf) * kexec_add_buffer - place a buffer in a kexec segment * @kbuf: Buffer contents and memory parameters. * - * This function assumes that kexec_mutex is held. + * This function assumes that kexec_lock is held. * On successful return, @kbuf->mem will have the physical address of * the buffer in memory. * diff --git a/security/integrity/ima/ima_kexec.c b/security/integrity/ima/ima_kexec.c index 419dc405c831..ad133fe120db 100644 --- a/security/integrity/ima/ima_kexec.c +++ b/security/integrity/ima/ima_kexec.c @@ -77,7 +77,7 @@ static int ima_dump_measurement_list(unsigned long *buffer_size, void **buffer, * Called during kexec_file_load so that IMA can add a segment to the kexec * image for the measurement list for the next kernel. * - * This function assumes that kexec_mutex is held. + * This function assumes that kexec_lock is held. */ void ima_add_kexec_buffer(struct kimage *image) {