Linux Kernel
3.7.1
|
#include <linux/errno.h>
#include <linux/sched.h>
#include <asm/segment.h>
#include <asm/uaccess_64.h>
Go to the source code of this file.
Data Structures | |
struct | __large_struct |
struct | exception_table_entry |
struct | mem_access |
Macros | |
#define | VERIFY_READ 0 |
#define | VERIFY_WRITE 1 |
#define | __addr_ok(addr) ((unsigned long __force)(addr) < current_thread_info()->addr_limit.seg) |
#define | __access_ok(addr, size) (__addr_ok((addr) + (size))) |
#define | access_ok(type, addr, size) |
#define | user_addr_max() (current_thread_info()->addr_limit.seg) |
#define | put_user(x, ptr) __put_user_check((x), (ptr), sizeof(*(ptr))) |
#define | get_user(x, ptr) __get_user_check((x), (ptr), sizeof(*(ptr))) |
#define | __put_user(x, ptr) __put_user_nocheck((x), (ptr), sizeof(*(ptr))) |
#define | __get_user(x, ptr) __get_user_nocheck((x), (ptr), sizeof(*(ptr))) |
#define | __m(x) (*(struct __large_struct __user *)(x)) |
#define | __get_user_nocheck(x, ptr, size) |
#define | __get_user_check(x, ptr, size) |
#define | __put_user_nocheck(x, ptr, size) |
#define | __put_user_check(x, ptr, size) |
#define | __copy_to_user_inatomic __copy_to_user |
#define | __copy_from_user_inatomic __copy_from_user |
#define | clear_user(addr, n) |
Functions | |
long | strncpy_from_user (char *dest, const char __user *src, long count) |
__must_check long | strlen_user (const char __user *str) |
__must_check long | strnlen_user (const char __user *str, long n) |
__kernel_size_t | __copy_user (void *to, const void *from, __kernel_size_t n) |
__kernel_size_t | __clear_user (void *addr, __kernel_size_t size) |
int | fixup_exception (struct pt_regs *regs) |
unsigned long | search_exception_table (unsigned long addr) |
struct exception_table_entry * | search_exception_tables (unsigned long addr) |
void * | set_exception_table_vec (unsigned int vec, void *handler) |
int | handle_unaligned_access (insn_size_t instruction, struct pt_regs *regs, struct mem_access *ma, int, unsigned long address) |
#define __addr_ok | ( | addr | ) | ((unsigned long __force)(addr) < current_thread_info()->addr_limit.seg) |
#define __copy_from_user_inatomic __copy_from_user |
#define __copy_to_user_inatomic __copy_to_user |
#define __get_user | ( | x, | |
ptr | |||
) | __get_user_nocheck((x), (ptr), sizeof(*(ptr))) |
#define user_addr_max | ( | ) | (current_thread_info()->addr_limit.seg) |
__kernel_size_t __clear_user | ( | void * | addr, |
__kernel_size_t | size | ||
) |
Definition at line 116 of file usercopy.c.
__kernel_size_t __copy_user | ( | void * | to, |
const void * | from, | ||
__kernel_size_t | n | ||
) |
int handle_unaligned_access | ( | insn_size_t | instruction, |
struct pt_regs * | regs, | ||
struct mem_access * | ma, | ||
int | , | ||
unsigned long | address | ||
) |
Definition at line 303 of file traps_32.c.
|
read |
Definition at line 761 of file traps_32.c.
__must_check long strlen_user | ( | const char __user * | str | ) |
strlen_user: - Get the size of a user string INCLUDING final NUL. : The string to measure.
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. On exception, returns 0.
If there is a limit on the length of a valid string, you may wish to consider using strnlen_user() instead.
Definition at line 126 of file strnlen_user.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.