[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2b539169-8acd-40c6-9261-47c0252df91a@amd.com>
Date: Tue, 5 Nov 2024 13:46:46 -0600
From: Mario Limonciello <mario.limonciello@....com>
To: Borislav Petkov <bp@...en8.de>, Yazen Ghannam <yazen.ghannam@....com>
Cc: linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org,
tony.luck@...el.com, x86@...nel.org, avadhut.naik@....com,
john.allen@....com, bhelgaas@...gle.com, Shyam-sundar.S-k@....com,
richard.gong@....com, jdelvare@...e.com, linux@...ck-us.net,
clemens@...isch.de, hdegoede@...hat.com, ilpo.jarvinen@...ux.intel.com,
linux-pci@...r.kernel.org, linux-hwmon@...r.kernel.org,
platform-driver-x86@...r.kernel.org, naveenkrishna.chatradhi@....com,
carlos.bilbao.osdev@...il.com
Subject: Re: [PATCH 16/16] x86/amd_smn: Add support for debugfs access to SMN
registers
On 11/5/2024 13:21, Borislav Petkov wrote:
> On Wed, Oct 23, 2024 at 05:21:50PM +0000, Yazen Ghannam wrote:
>> +static ssize_t smn_value_write(struct file *file, const char __user *userbuf,
>> + size_t count, loff_t *ppos)
>> +{
>> + u32 val;
>> + int ret;
>> +
>> + ret = kstrtouint_from_user(userbuf, count, 0, &val);
>> + if (ret)
>> + return ret;
>> +
>> + add_taint(TAINT_USER, LOCKDEP_STILL_OK);
>
> That looks like a TAINT_CPU_OUT_OF_SPEC to me.
Makes sense.
>
>> + ret = amd_smn_write(debug_node, debug_address, val);
>> + if (ret)
>> + return ret;
>> +
>> + return count;
>> +}
>> +
>> +DEFINE_SHOW_STORE_ATTRIBUTE(smn_node);
>> +DEFINE_SHOW_STORE_ATTRIBUTE(smn_address);
>> +DEFINE_SHOW_STORE_ATTRIBUTE(smn_value);
>> +
>> static int amd_cache_roots(void)
>> {
>> u16 node, num_nodes = amd_num_nodes();
>> @@ -180,6 +257,12 @@ static int __init amd_smn_init(void)
>> if (err)
>> return err;
>>
>> + debugfs_dir = debugfs_create_dir("amd_smn", arch_debugfs_dir);
>> +
>> + debugfs_create_file("node", 0600, debugfs_dir, NULL, &smn_node_fops);
>> + debugfs_create_file("address", 0600, debugfs_dir, NULL, &smn_address_fops);
>> + debugfs_create_file("value", 0600, debugfs_dir, NULL, &smn_value_fops);
>
> Can we pls stick this behind a module param which is off by default? I don't
> want that crap exposed even in debugfs, by default.
>
> Thx.
>
Why the worry about it being in debugfs by default?
Powered by blists - more mailing lists