Linux Kernel
3.7.1
|
#include <linux/thread_info.h>
#include <linux/kernel.h>
#include <asm/page.h>
#include <asm/errno.h>
Go to the source code of this file.
Data Structures | |
struct | exception_table_entry |
struct | __large_struct |
Functions | |
int | fixup_exception (struct pt_regs *regs) |
int | __get_user_unknown (void) |
int | __put_user_unknown (void) |
unsigned long | __generic_copy_to_user (void __user *, const void *, unsigned long) |
unsigned long | __generic_copy_from_user (void *, const void __user *, unsigned long) |
long | strncpy_from_user (char *dst, const char __user *src, long count) |
long | __strncpy_from_user (char *dst, const char __user *src, long count) |
long | strnlen_user (const char __user *str, long n) |
unsigned long | clear_user (void __user *mem, unsigned long len) |
unsigned long | __clear_user (void __user *mem, unsigned long len) |
#define __access_ok | ( | addr, | |
size | |||
) | (__range_ok((addr), (size)) == 0) |
#define __addr_ok | ( | addr | ) | ((unsigned long)(addr) < (current_thread_info()->addr_limit.seg)) |
#define __get_user | ( | x, | |
ptr | |||
) | __get_user_nocheck((x), (ptr), sizeof(*(ptr))) |
#define __get_user_asm | ( | INSN | ) |
#define __kernel_ds_p | ( | ) | (current_thread_info()->addr_limit.seg == 0x9FFFFFFF) |
#define __put_user_asm | ( | INSN | ) |
#define __put_user_asm8 | ( | ) |
#define copy_from_user | ( | to, | |
from, | |||
n | |||
) | __generic_copy_from_user((to), (from), (n)) |
#define copy_to_user | ( | to, | |
from, | |||
n | |||
) | __generic_copy_to_user((to), (from), (n)) |
#define get_fs | ( | void | ) | (current_thread_info()->addr_limit) |
#define KERNEL_DS MAKE_MM_SEG(0x9FFFFFFF) |
#define KERNEL_XDS MAKE_MM_SEG(0xBFFFFFFF) |
#define MAKE_MM_SEG | ( | s | ) | ((mm_segment_t) { (s) }) |
#define set_fs | ( | x | ) | (current_thread_info()->addr_limit = (x)) |
#define strlen_user | ( | str | ) | strnlen_user(str, ~0UL >> 1) |
#define USER_DS MAKE_MM_SEG(TASK_SIZE) |
__clear_user: - Zero a block of memory in user space, with less checking. : Destination address, in user space.
: Number of bytes to zero.
Zero a block of memory in user space. Caller must check the specified block with access_ok() before calling this function.
Returns number of bytes that could not be cleared. On success, this will be zero.
Definition at line 158 of file uaccess_with_memcpy.c.
Definition at line 24 of file usercopy.c.
Definition at line 15 of file usercopy.c.
Definition at line 113 of file usercopy.c.
clear_user: - Zero a block of memory in user space. : Destination address, in user space.
: Number of bytes to zero.
Zero a block of memory in user space. Caller must check the specified block with access_ok() before calling this function.
Returns number of bytes that could not be cleared. On success, this will be zero.
clear_user: - Zero a block of memory in user space. : Destination address, in user space.
: Number of bytes to zero.
Zero a block of memory in user space.
Returns number of bytes that could not be cleared. On success, this will be zero.
Definition at line 224 of file usercopy.c.
strncpy_from_user: - Copy a NUL terminated string from userspace. : Destination address, in kernel space. This buffer must be at least bytes long. : Source address, in user space. : Maximum number of bytes to copy, including the trailing NUL.
Copies a NUL-terminated string from userspace to kernel space.
On success, returns the length of the string (not including the trailing NUL).
If access to userspace fails, returns -EFAULT (some data may have been copied).
If is smaller than the length of the string, copies bytes and returns .
strnlen_user: - Get the size of a user string INCLUDING final NUL. : The string to measure. : Maximum count (including NUL character)
Context: User context only. This function may sleep.
Get the size of a NUL-terminated string in user space.
Returns the size of the string INCLUDING the terminating NUL. If the string is too long, returns 'count+1'. On exception (or invalid count), returns 0.