.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * 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. |
---|
7 | 4 | */ |
---|
8 | 5 | |
---|
9 | 6 | #include <linux/uaccess.h> |
---|
10 | 7 | #include <linux/kernel.h> |
---|
11 | 8 | #include <os.h> |
---|
12 | 9 | |
---|
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) |
---|
14 | 11 | { |
---|
15 | 12 | void *psrc = (void *)rounddown((unsigned long)src, PAGE_SIZE); |
---|
16 | 13 | |
---|
17 | 14 | if ((unsigned long)src < PAGE_SIZE || size <= 0) |
---|
18 | | - return -EFAULT; |
---|
19 | | - |
---|
| 15 | + return false; |
---|
20 | 16 | 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; |
---|
24 | 19 | } |
---|