hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/arch/um/kernel/maccess.c
....@@ -1,24 +1,19 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2013 Richard Weinberger <richrd@nod.at>
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
74 */
85
96 #include <linux/uaccess.h>
107 #include <linux/kernel.h>
118 #include <os.h>
129
13
-long probe_kernel_read(void *dst, const void *src, size_t size)
10
+bool copy_from_kernel_nofault_allowed(const void *src, size_t size)
1411 {
1512 void *psrc = (void *)rounddown((unsigned long)src, PAGE_SIZE);
1613
1714 if ((unsigned long)src < PAGE_SIZE || size <= 0)
18
- return -EFAULT;
19
-
15
+ return false;
2016 if (os_mincore(psrc, size + src - psrc) <= 0)
21
- return -EFAULT;
22
-
23
- return __probe_kernel_read(dst, src, size);
17
+ return false;
18
+ return true;
2419 }