hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/parisc/lib/memcpy.c
....@@ -1,26 +1,12 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Optimized memory copy routines.
34 *
45 * Copyright (C) 2004 Randolph Chung <tausq@debian.org>
56 * Copyright (C) 2013-2017 Helge Deller <deller@gmx.de>
67 *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License as published by
9
- * the Free Software Foundation; either version 2, or (at your option)
10
- * any later version.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License
18
- * along with this program; if not, write to the Free Software
19
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
- *
218 * Portions derived from the GNU C Library
229 * Copyright (C) 1991, 1997, 2003 Free Software Foundation, Inc.
23
- *
2410 */
2511
2612 #include <linux/module.h>
....@@ -71,14 +57,10 @@
7157 EXPORT_SYMBOL(raw_copy_in_user);
7258 EXPORT_SYMBOL(memcpy);
7359
74
-long probe_kernel_read(void *dst, const void *src, size_t size)
60
+bool copy_from_kernel_nofault_allowed(const void *unsafe_src, size_t size)
7561 {
76
- unsigned long addr = (unsigned long)src;
77
-
78
- if (addr < PAGE_SIZE)
79
- return -EFAULT;
80
-
62
+ if ((unsigned long)unsafe_src < PAGE_SIZE)
63
+ return false;
8164 /* check for I/O space F_EXTEND(0xfff00000) access as well? */
82
-
83
- return __probe_kernel_read(dst, src, size);
65
+ return true;
8466 }