| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * rodata_test.c: functional test for mark_rodata_ro function |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * (C) Copyright 2008 Intel Corporation |
|---|
| 5 | 6 | * 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. |
|---|
| 11 | 7 | */ |
|---|
| 12 | 8 | #define pr_fmt(fmt) "rodata_test: " fmt |
|---|
| 13 | 9 | |
|---|
| 10 | +#include <linux/rodata_test.h> |
|---|
| 14 | 11 | #include <linux/uaccess.h> |
|---|
| 15 | 12 | #include <asm/sections.h> |
|---|
| 16 | 13 | |
|---|
| .. | .. |
|---|
| 29 | 26 | } |
|---|
| 30 | 27 | |
|---|
| 31 | 28 | /* 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, |
|---|
| 33 | 30 | (void *)&zero, sizeof(zero))) { |
|---|
| 34 | 31 | pr_err("test data was not read only\n"); |
|---|
| 35 | 32 | return; |
|---|