the thing
This commit is contained in:
44
module.c
Normal file
44
module.c
Normal file
@@ -0,0 +1,44 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0
|
||||
*
|
||||
* Copyright (C) 2026 silt <silt@0xC3.win>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/printk.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/version.h>
|
||||
#include <linux/string.h>
|
||||
#include <asm/msr.h>
|
||||
|
||||
MODULE_AUTHOR("silt <silt@0xC3.win>");
|
||||
MODULE_DESCRIPTION("Implements the mitigation for CVE-2025-54505 as described by AMD-SB-7053");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
||||
static int __init init(void) {
|
||||
pr_info("Applying MSR fix for FP-DSS (CVE-2025-54505, AMD-SB-7053)\n");
|
||||
|
||||
int err = msr_set_bit(0xC0011028, 9);
|
||||
if (err < 0) {
|
||||
pr_warn("Failed to apply fix for FP-DSS: %d\n", err);
|
||||
} else if (err == 0) {
|
||||
pr_info("Fix was previously applied. Bailing from init.\n");
|
||||
}
|
||||
pr_info("Fix applied successfully. Bailing from init.\n");
|
||||
|
||||
return -1;
|
||||
}
|
||||
module_init(init);
|
||||
Reference in New Issue
Block a user