lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201125172907.240996-5-mike.travis@hpe.com>
Date:   Wed, 25 Nov 2020 11:29:06 -0600
From:   Mike Travis <mike.travis@....com>
To:     Hans de Goede <hdegoede@...hat.com>,
        Justin Ernst <justin.ernst@....com>,
        Mark Gross <mgross@...ux.intel.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        x86@...nel.org, Steve Wahl <steve.wahl@....com>
Cc:     Mike Travis <mike.travis@....com>,
        Dimitri Sivanich <dimitri.sivanich@....com>,
        Russ Anderson <russ.anderson@....com>,
        "H. Peter Anvin" <hpa@...or.com>,
        Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
        Suzuki K Poulose <suzuki.poulose@....com>,
        Ilya Dryomov <idryomov@...il.com>,
        linux-kernel@...r.kernel.org, platform-driver-x86@...r.kernel.org
Subject: [PATCH 4/5] x86/platform/uv: Add deprecated messages to /proc info leaves

Add "deprecated" message to any access to old /proc/sgi_uv/* leaves.

Signed-off-by: Mike Travis <mike.travis@....com>
Reviewed-by: Steve Wahl <steve.wahl@....com>
---
 arch/x86/kernel/apic/x2apic_uv_x.c | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
index 48746031b39a..bfd77a00c2a1 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -1615,21 +1615,45 @@ static void check_efi_reboot(void)
 		reboot_type = BOOT_ACPI;
 }
 
-/* Setup user proc fs files */
+/*
+ * User proc fs file handling now deprecated.
+ * Recommend using /sys/firmware/sgi_uv/... instead.
+ */
+static void proc_print_msg(int *flag, char *what, char *which)
+{
+	if (*flag)
+		return;
+
+	pr_notice(
+		"%s: using deprecated /proc/sgi_uv/%s, use /sys/firmware/sgi_uv/%s\n",
+		current->comm, what, which ? which : what);
+
+	*flag = 1;
+}
+
 static int __maybe_unused proc_hubbed_show(struct seq_file *file, void *data)
 {
+	static int flag;
+
+	proc_print_msg(&flag, "hubbed", "hub_type");
 	seq_printf(file, "0x%x\n", uv_hubbed_system);
 	return 0;
 }
 
 static int __maybe_unused proc_hubless_show(struct seq_file *file, void *data)
 {
+	static int flag;
+
+	proc_print_msg(&flag, "hubless", NULL);
 	seq_printf(file, "0x%x\n", uv_hubless_system);
 	return 0;
 }
 
 static int __maybe_unused proc_archtype_show(struct seq_file *file, void *data)
 {
+	static int flag;
+
+	proc_print_msg(&flag, "archtype", NULL);
 	seq_printf(file, "%s/%s\n", uv_archtype, oem_table_id);
 	return 0;
 }
-- 
2.21.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ