Linux Kernel
3.7.1
|
#include <linux/errno.h>
#include <linux/sched.h>
Go to the source code of this file.
Data Structures | |
struct | __large_struct |
struct | exception_table_entry |
union | exception_table_entry::exception_fixup |
Functions | |
void | __get_user_unknown (void) |
void | __put_user_unknown (void) |
void | __copy_user (void) |
long | __copy_tofrom_user_nocheck (void *to, const void *from, long len) |
long | __copy_tofrom_user (void *to, const void *from, long len, const void __user *validate) |
long | copy_to_user (void __user *to, const void *from, long n) |
long | copy_from_user (void *to, const void __user *from, long n) |
void | __do_clear_user (void) |
long | __clear_user (void __user *to, long len) |
long | clear_user (void __user *to, long len) |
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) |
#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 __get_user_16 | ( | addr | ) |
#define __get_user_32 | ( | addr | ) |
#define __get_user_64 | ( | addr | ) |
#define __get_user_8 | ( | addr | ) |
#define fixup_exception | ( | map_reg, | |
_fixup, | |||
pc | |||
) |
#define get_fs | ( | void | ) | (current_thread_info()->addr_limit) |
#define KERNEL_DS ((mm_segment_t) { 0UL }) |
#define set_fs | ( | x | ) | (current_thread_info()->addr_limit = (x)) |
#define user_addr_max | ( | ) | (segment_eq(get_fs(), USER_DS) ? TASK_SIZE : ~0UL) |
#define USER_DS ((mm_segment_t) { -0x40000000000UL }) |
__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.