Lines Matching +full:xor +full:- +full:v2
1 // SPDX-License-Identifier: GPL-2.0
23 * We don't expose the real in-memory order of objects for security reasons.
27 * The obfuscation is done in two steps. First we xor the kernel pointer with
29 * Secondly we multiply the xor production with a large odd random number to
45 * 0 - equal, i.e. v1 = v2
46 * 1 - less than, i.e. v1 < v2
47 * 2 - greater than, i.e. v1 > v2
48 * 3 - not equal but ordering unavailable (reserved for future)
50 static int kcmp_ptr(void *v1, void *v2, enum kcmp_type type) in kcmp_ptr() argument
55 t2 = kptr_obfuscate((long)v2, type); in kcmp_ptr()
109 return -EFAULT; in kcmp_epoll_target()
113 return -EBADF; in kcmp_epoll_target()
117 return -EBADF; in kcmp_epoll_target()
133 return -EOPNOTSUPP; in kcmp_epoll_target()
161 ret = kcmp_lock(&task1->signal->exec_update_lock, in SYSCALL_DEFINE5()
162 &task2->signal->exec_update_lock); in SYSCALL_DEFINE5()
167 ret = -EPERM; in SYSCALL_DEFINE5()
181 ret = -EBADF; in SYSCALL_DEFINE5()
185 ret = kcmp_ptr(task1->mm, task2->mm, KCMP_VM); in SYSCALL_DEFINE5()
188 ret = kcmp_ptr(task1->files, task2->files, KCMP_FILES); in SYSCALL_DEFINE5()
191 ret = kcmp_ptr(task1->fs, task2->fs, KCMP_FS); in SYSCALL_DEFINE5()
194 ret = kcmp_ptr(task1->sighand, task2->sighand, KCMP_SIGHAND); in SYSCALL_DEFINE5()
197 ret = kcmp_ptr(task1->io_context, task2->io_context, KCMP_IO); in SYSCALL_DEFINE5()
201 ret = kcmp_ptr(task1->sysvsem.undo_list, in SYSCALL_DEFINE5()
202 task2->sysvsem.undo_list, in SYSCALL_DEFINE5()
205 ret = -EOPNOTSUPP; in SYSCALL_DEFINE5()
212 ret = -EINVAL; in SYSCALL_DEFINE5()
217 kcmp_unlock(&task1->signal->exec_update_lock, in SYSCALL_DEFINE5()
218 &task2->signal->exec_update_lock); in SYSCALL_DEFINE5()
227 return -ESRCH; in SYSCALL_DEFINE5()