hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/mm/rodata_test.c
....@@ -1,16 +1,13 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * rodata_test.c: functional test for mark_rodata_ro function
34 *
45 * (C) Copyright 2008 Intel Corporation
56 * Author: Arjan van de Ven <arjan@linux.intel.com>
6
- *
7
- * This program is free software; you can redistribute it and/or
8
- * modify it under the terms of the GNU General Public License
9
- * as published by the Free Software Foundation; version 2
10
- * of the License.
117 */
128 #define pr_fmt(fmt) "rodata_test: " fmt
139
10
+#include <linux/rodata_test.h>
1411 #include <linux/uaccess.h>
1512 #include <asm/sections.h>
1613
....@@ -29,7 +26,7 @@
2926 }
3027
3128 /* test 2: write to the variable; this should fault */
32
- if (!probe_kernel_write((void *)&rodata_test_data,
29
+ if (!copy_to_kernel_nofault((void *)&rodata_test_data,
3330 (void *)&zero, sizeof(zero))) {
3431 pr_err("test data was not read only\n");
3532 return;