Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
compat.c File Reference
#include <linux/kernel.h>
#include <linux/gfp.h>
#include <linux/fs.h>
#include <linux/types.h>
#include <linux/file.h>
#include <linux/icmpv6.h>
#include <linux/socket.h>
#include <linux/syscalls.h>
#include <linux/filter.h>
#include <linux/compat.h>
#include <linux/security.h>
#include <linux/export.h>
#include <net/scm.h>
#include <net/sock.h>
#include <net/ip.h>
#include <net/ipv6.h>
#include <asm/uaccess.h>
#include <net/compat.h>

Go to the source code of this file.

Data Structures

struct  compat_group_req
 
struct  compat_group_source_req
 
struct  compat_group_filter
 

Macros

#define CMSG_COMPAT_ALIGN(len)   ALIGN((len), sizeof(s32))
 
#define CMSG_COMPAT_DATA(cmsg)   ((void __user *)((char __user *)(cmsg) + CMSG_COMPAT_ALIGN(sizeof(struct compat_cmsghdr))))
 
#define CMSG_COMPAT_SPACE(len)   (CMSG_COMPAT_ALIGN(sizeof(struct compat_cmsghdr)) + CMSG_COMPAT_ALIGN(len))
 
#define CMSG_COMPAT_LEN(len)   (CMSG_COMPAT_ALIGN(sizeof(struct compat_cmsghdr)) + (len))
 
#define CMSG_COMPAT_FIRSTHDR(msg)
 
#define CMSG_COMPAT_OK(ucmlen, ucmsg, mhdr)
 
#define __COMPAT_GF0_SIZE
 
#define AL(x)   ((x) * sizeof(u32))
 

Functions

int get_compat_msghdr (struct msghdr *kmsg, struct compat_msghdr __user *umsg)
 
int verify_compat_iovec (struct msghdr *kern_msg, struct iovec *kern_iov, struct sockaddr_storage *kern_address, int mode)
 
int cmsghdr_from_user_compat_to_kern (struct msghdr *kmsg, struct sock *sk, unsigned char *stackbuf, int stackbuf_size)
 
int put_cmsg_compat (struct msghdr *kmsg, int level, int type, int len, void *data)
 
void scm_detach_fds_compat (struct msghdr *kmsg, struct scm_cookie *scm)
 
asmlinkage long compat_sys_setsockopt (int fd, int level, int optname, char __user *optval, unsigned int optlen)
 
int compat_sock_get_timestamp (struct sock *sk, struct timeval __user *userstamp)
 
 EXPORT_SYMBOL (compat_sock_get_timestamp)
 
int compat_sock_get_timestampns (struct sock *sk, struct timespec __user *userstamp)
 
 EXPORT_SYMBOL (compat_sock_get_timestampns)
 
asmlinkage long compat_sys_getsockopt (int fd, int level, int optname, char __user *optval, int __user *optlen)
 
int compat_mc_setsockopt (struct sock *sock, int level, int optname, char __user *optval, unsigned int optlen, int(*setsockopt)(struct sock *, int, int, char __user *, unsigned int))
 
 EXPORT_SYMBOL (compat_mc_setsockopt)
 
int compat_mc_getsockopt (struct sock *sock, int level, int optname, char __user *optval, int __user *optlen, int(*getsockopt)(struct sock *, int, int, char __user *, int __user *))
 
 EXPORT_SYMBOL (compat_mc_getsockopt)
 
asmlinkage long compat_sys_sendmsg (int fd, struct compat_msghdr __user *msg, unsigned int flags)
 
asmlinkage long compat_sys_sendmmsg (int fd, struct compat_mmsghdr __user *mmsg, unsigned int vlen, unsigned int flags)
 
asmlinkage long compat_sys_recvmsg (int fd, struct compat_msghdr __user *msg, unsigned int flags)
 
asmlinkage long compat_sys_recv (int fd, void __user *buf, size_t len, unsigned int flags)
 
asmlinkage long compat_sys_recvfrom (int fd, void __user *buf, size_t len, unsigned int flags, struct sockaddr __user *addr, int __user *addrlen)
 
asmlinkage long compat_sys_recvmmsg (int fd, struct compat_mmsghdr __user *mmsg, unsigned int vlen, unsigned int flags, struct compat_timespec __user *timeout)
 
asmlinkage long compat_sys_socketcall (int call, u32 __user *args)
 

Variables

struct compat_group_req __packed
 

Macro Definition Documentation

#define __COMPAT_GF0_SIZE
Value:

Definition at line 555 of file compat.c.

#define AL (   x)    ((x) * sizeof(u32))

Definition at line 726 of file compat.c.

#define CMSG_COMPAT_ALIGN (   len)    ALIGN((len), sizeof(s32))

Definition at line 108 of file compat.c.

#define CMSG_COMPAT_DATA (   cmsg)    ((void __user *)((char __user *)(cmsg) + CMSG_COMPAT_ALIGN(sizeof(struct compat_cmsghdr))))

Definition at line 110 of file compat.c.

#define CMSG_COMPAT_FIRSTHDR (   msg)
Value:
(((msg)->msg_controllen) >= sizeof(struct compat_cmsghdr) ? \
(struct compat_cmsghdr __user *)((msg)->msg_control) : \
(struct compat_cmsghdr __user *)NULL)

Definition at line 117 of file compat.c.

#define CMSG_COMPAT_LEN (   len)    (CMSG_COMPAT_ALIGN(sizeof(struct compat_cmsghdr)) + (len))

Definition at line 114 of file compat.c.

#define CMSG_COMPAT_OK (   ucmlen,
  ucmsg,
  mhdr 
)
Value:
((ucmlen) >= sizeof(struct compat_cmsghdr) && \
(ucmlen) <= (unsigned long) \
((mhdr)->msg_controllen - \
((char *)(ucmsg) - (char *)(mhdr)->msg_control)))

Definition at line 122 of file compat.c.

#define CMSG_COMPAT_SPACE (   len)    (CMSG_COMPAT_ALIGN(sizeof(struct compat_cmsghdr)) + CMSG_COMPAT_ALIGN(len))

Definition at line 112 of file compat.c.

Function Documentation

int cmsghdr_from_user_compat_to_kern ( struct msghdr kmsg,
struct sock sk,
unsigned char stackbuf,
int  stackbuf_size 
)

Definition at line 142 of file compat.c.

int compat_mc_getsockopt ( struct sock sock,
int  level,
int  optname,
char __user optval,
int __user optlen,
int(*)(struct sock *, int, int, char __user *, int __user *)  getsockopt 
)

Definition at line 646 of file compat.c.

int compat_mc_setsockopt ( struct sock sock,
int  level,
int  optname,
char __user optval,
unsigned int  optlen,
int(*)(struct sock *, int, int, char __user *, unsigned int setsockopt 
)

Definition at line 559 of file compat.c.

int compat_sock_get_timestamp ( struct sock sk,
struct timeval __user userstamp 
)

Definition at line 448 of file compat.c.

int compat_sock_get_timestampns ( struct sock sk,
struct timespec __user userstamp 
)

Definition at line 476 of file compat.c.

asmlinkage long compat_sys_getsockopt ( int  fd,
int  level,
int  optname,
char __user optval,
int __user optlen 
)

Definition at line 504 of file compat.c.

asmlinkage long compat_sys_recv ( int  fd,
void __user buf,
size_t  len,
unsigned int  flags 
)

Definition at line 752 of file compat.c.

asmlinkage long compat_sys_recvfrom ( int  fd,
void __user buf,
size_t  len,
unsigned int  flags,
struct sockaddr __user addr,
int __user addrlen 
)

Definition at line 757 of file compat.c.

asmlinkage long compat_sys_recvmmsg ( int  fd,
struct compat_mmsghdr __user mmsg,
unsigned int  vlen,
unsigned int  flags,
struct compat_timespec __user timeout 
)

Definition at line 764 of file compat.c.

asmlinkage long compat_sys_recvmsg ( int  fd,
struct compat_msghdr __user msg,
unsigned int  flags 
)

Definition at line 747 of file compat.c.

asmlinkage long compat_sys_sendmmsg ( int  fd,
struct compat_mmsghdr __user mmsg,
unsigned int  vlen,
unsigned int  flags 
)

Definition at line 740 of file compat.c.

asmlinkage long compat_sys_sendmsg ( int  fd,
struct compat_msghdr __user msg,
unsigned int  flags 
)

Definition at line 735 of file compat.c.

asmlinkage long compat_sys_setsockopt ( int  fd,
int  level,
int  optname,
char __user optval,
unsigned int  optlen 
)

Definition at line 384 of file compat.c.

asmlinkage long compat_sys_socketcall ( int  call,
u32 __user args 
)

Definition at line 791 of file compat.c.

EXPORT_SYMBOL ( compat_sock_get_timestamp  )
EXPORT_SYMBOL ( compat_sock_get_timestampns  )
EXPORT_SYMBOL ( compat_mc_setsockopt  )
EXPORT_SYMBOL ( compat_mc_getsockopt  )
int get_compat_msghdr ( struct msghdr kmsg,
struct compat_msghdr __user umsg 
)

Definition at line 61 of file compat.c.

int put_cmsg_compat ( struct msghdr kmsg,
int  level,
int  type,
int  len,
void data 
)

Definition at line 220 of file compat.c.

void scm_detach_fds_compat ( struct msghdr kmsg,
struct scm_cookie scm 
)

Definition at line 276 of file compat.c.

int verify_compat_iovec ( struct msghdr kern_msg,
struct iovec kern_iov,
struct sockaddr_storage kern_address,
int  mode 
)

Definition at line 81 of file compat.c.

Variable Documentation