1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/linux/hotfix-mount.patch.sparc64
3 # Copyright (C) 2024 The T2 SDE Project
5 # This Copyright note is generated by scripts/Create-CopyPatch,
6 # more information can be found in the files COPYING and README.
8 # This patch file is dual-licensed. It is available under the license the
9 # patched project is licensed under, as long as it is an OpenSource license
10 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
11 # of the GNU General Public License version 2 as used by the T2 SDE.
12 # --- T2-COPYRIGHT-NOTE-END ---
14 d563d678aa0 in 2020 causes some page table corruption ot TLB invalidation
15 on sparc, revert for now until is further analyzed.
20 void *copy_mount_options(const void __user * data)
24 - unsigned left, offset;
28 @@ -3084,27 +3084,16 @@
30 return ERR_PTR(-ENOMEM);
32 + size = PAGE_SIZE - offset_in_page(data);
33 - left = copy_from_user(copy, data, PAGE_SIZE);
35 + if (copy_from_user(copy, data, size)) {
37 - * Not all architectures have an exact copy_from_user(). Resort to
40 - offset = PAGE_SIZE - left;
43 - if (get_user(c, (const char __user *)data + offset))
50 - if (left == PAGE_SIZE) {
52 return ERR_PTR(-EFAULT);
54 + if (size != PAGE_SIZE) {
55 + if (copy_from_user(copy + size, data + size, PAGE_SIZE - size))
56 + memset(copy + size, 0, PAGE_SIZE - size);