Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3908286pxm; Tue, 1 Mar 2022 07:40:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJzlA7uUbAVLIbfw74jngPZnxVjEkia+G5xLgfiCNDWeIHzpn12I+yIzqEmjFwyrb7vVLT+l X-Received: by 2002:a17:906:2b93:b0:6cf:bb48:5a80 with SMTP id m19-20020a1709062b9300b006cfbb485a80mr19001783ejg.681.1646149224028; Tue, 01 Mar 2022 07:40:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646149224; cv=none; d=google.com; s=arc-20160816; b=mq4h/QdCiyHvfiMPY7DkfUN3EF9oeAhFh3ov71s3O/1Um5aWejn/6VZbseSA6panZC +WA00u5WjPnA3HZvlumdXqmY9Lmt6e6Iw5Vi9olkzAE7ulHKT4J7oBVp24Xghb1Hc1lE gomW15XZuCNAKwQwtZj7rwFgMkOjC/lO4Bim8YtETzQPlhPgyH9JbevKcePy0oXz8qpe /ab5VKd+MK3QlvizBn5MEW/V4h4mJQTKwVGNJ/FyqnzFNNcEqC6rYsoHvTQJloJUb9sB 0XsgApDJaBq1tj8yXpmc1ODQ/JQIp1ZVJoBkacCz7B1aGPTHekfJCQVDrZ5r3apsgwCJ zU+w== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=XbBh6y93WJCYOvDM+EJo5FnNHZVWpJseZ0yP8iYWZjM=; b=ZegK665+FBTunaN96Aw9mdq0cx2RTb3uLO8LbORjRHhzv77FA4nnrp292jcsOCxSFW kF4JjHVxG3V5Ik04v/brtSr++k1OqFMVdYEnGsmF/+5W+S44PnzWSXHRB6/oepY/d19i V9kPU19mhQqgAmqK/RBXcuMICMgaC6WeG7iRv9RJ8ds2oYgnNanN6V17mOwhxxIn2o+H nqioFS2+RGnhm4FFysgeOGbG3Dx75F6xOMrJsFR9Z3CaG6zxOexTmqY6cmZrUs1hTYOp L+SffkXmLtZIW/HbfoVhx6M1/6R2f2VXM/ZeLKNLCPwOcB+T0RNkjFW5X4bS3/+wxmTs a14w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fqZEtVsw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j8-20020a1709064b4800b006b583ddefffsi8212352ejv.94.2022.03.01.07.40.01; Tue, 01 Mar 2022 07:40:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fqZEtVsw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235198AbiCAON6 (ORCPT + 99 others); Tue, 1 Mar 2022 09:13:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235195AbiCAONy (ORCPT ); Tue, 1 Mar 2022 09:13:54 -0500 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 664077B546; Tue, 1 Mar 2022 06:13:12 -0800 (PST) Received: by mail-ed1-x533.google.com with SMTP id h15so22163121edv.7; Tue, 01 Mar 2022 06:13:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XbBh6y93WJCYOvDM+EJo5FnNHZVWpJseZ0yP8iYWZjM=; b=fqZEtVsw5rl7Bz7p190YAW0lU17YEGBHKeYRlulUChvlYfA9iWrdOg/S5o0HRtufm1 2OCQfBKCTZVS948bFOJZL6d0OxZ/IzPmkHoSCQW0xXSuUaTizzmU8kUqNOepxqb1sXkw 0ziB0E7drug+XroNZAJciOBFtw6TSpXipHhawLAihu4s/TcHC601OmEWVl96vQ6pJ+bK MFvhc/W74C/HKCt1mt5ujCiS6JSegf92fxZ+y8Zrif4ZYFgSZETA2mi6z7OpHY5pr33t CRJB4q/LpKba0PfvCjd0fRjNYrsclJCiQDYhRCVKJNgACv7FEsE5tijsdVZkV1YDjzrt d4QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XbBh6y93WJCYOvDM+EJo5FnNHZVWpJseZ0yP8iYWZjM=; b=2QlmWi20FQmCmSFrJ4WBSkWWRWlCAEBcPfnx5cQZbTeoJxdeSq3JkGSwSmc4JRM5tu QVrcwBe2vw1mLdCJmfVCdN20GxuYxqIAU4d8hPSrF4UsOil8lks/ZKT5pwh7FbDuPH18 8WapY6+zdoQbpwIPFYA5uuLWGkF5VIehm8IBtgQDgx1iMHVRnD1Bc0Kte1Xxg3o8Hy5j luGEtd/oz5WN7Bspd195fyYu3DwV5VkLY5bcaVT4hbV7yvimzwOh++c+0bKzwoCnxzgT AJ56et/Ak/3oL0UJkgO2FvLgdffKswBlJ7qnQXpp3AtqPt6M4VldARGW8ULTaWDm6poM QGTA== X-Gm-Message-State: AOAM530P5MP4ug8VzC1afBEb+a6Q0nAxAyoEDML5CaU4rlQGf0fm9vk0 8cFM3kj0N4EashlZU/TC7CCvKFSkVsFeJQ== X-Received: by 2002:a05:6402:11ce:b0:412:f162:28e8 with SMTP id j14-20020a05640211ce00b00412f16228e8mr24577969edw.341.1646143990829; Tue, 01 Mar 2022 06:13:10 -0800 (PST) Received: from anparri.mshome.net ([87.13.191.110]) by smtp.gmail.com with ESMTPSA id q15-20020a1709060e4f00b006cdf4535cf2sm5341883eji.67.2022.03.01.06.13.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 06:13:10 -0800 (PST) From: "Andrea Parri (Microsoft)" To: KY Srinivasan , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , Michael Kelley Cc: linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, "Andrea Parri (Microsoft)" Subject: [PATCH] Drivers: hv: vmbus: Deactivate sysctl_record_panic_msg by default in isolated guests Date: Tue, 1 Mar 2022 15:11:35 +0100 Message-Id: <20220301141135.2232-1-parri.andrea@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org hv_panic_page might contain guest-sensitive information, do not dump it over to Hyper-V by default in isolated guests. While at it, update some comments in hyperv_{panic,die}_event(). Reported-by: Dexuan Cui Signed-off-by: Andrea Parri (Microsoft) --- drivers/hv/vmbus_drv.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 12a2b37e87f30..a963b970ffb2f 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -77,8 +77,8 @@ static int hyperv_panic_event(struct notifier_block *nb, unsigned long val, /* * Hyper-V should be notified only once about a panic. If we will be - * doing hyperv_report_panic_msg() later with kmsg data, don't do - * the notification here. + * doing hv_kmsg_dump() with kmsg data later, don't do the notification + * here. */ if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE && hyperv_report_reg()) { @@ -100,8 +100,8 @@ static int hyperv_die_event(struct notifier_block *nb, unsigned long val, /* * Hyper-V should be notified only once about a panic. If we will be - * doing hyperv_report_panic_msg() later with kmsg data, don't do - * the notification here. + * doing hv_kmsg_dump() with kmsg data later, don't do the notification + * here. */ if (hyperv_report_reg()) hyperv_report_panic(regs, val, true); @@ -1546,14 +1546,20 @@ static int vmbus_bus_init(void) if (ret) goto err_connect; + if (hv_is_isolation_supported()) + sysctl_record_panic_msg = 0; + /* * Only register if the crash MSRs are available */ if (ms_hyperv.misc_features & HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE) { u64 hyperv_crash_ctl; /* - * Sysctl registration is not fatal, since by default - * reporting is enabled. + * Panic message recording (sysctl_record_panic_msg) + * is enabled by default in non-isolated guests and + * disabled by default in isolated guests; the panic + * message recording won't be available in isolated + * guests should the following registration fail. */ hv_ctl_table_hdr = register_sysctl_table(hv_root_table); if (!hv_ctl_table_hdr) -- 2.25.1