socket.c (1f782fee18b39b9ad438ebbd82c2915a16c879ee) socket.c (f845172531fb7410c7fb7780b1a6e51ee6df7d52)
1/*
2 * NET An implementation of the SOCKET network access protocol.
3 *
4 * Version: @(#)socket.c 1.1.93 18/02/95
5 *
6 * Authors: Orest Zborowski, <obz@Kodak.COM>
7 * Ross Biro
8 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>

--- 80 unchanged lines hidden (view full) ---

89#include <linux/magic.h>
90#include <linux/slab.h>
91
92#include <asm/uaccess.h>
93#include <asm/unistd.h>
94
95#include <net/compat.h>
96#include <net/wext.h>
1/*
2 * NET An implementation of the SOCKET network access protocol.
3 *
4 * Version: @(#)socket.c 1.1.93 18/02/95
5 *
6 * Authors: Orest Zborowski, <obz@Kodak.COM>
7 * Ross Biro
8 * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>

--- 80 unchanged lines hidden (view full) ---

89#include <linux/magic.h>
90#include <linux/slab.h>
91
92#include <asm/uaccess.h>
93#include <asm/unistd.h>
94
95#include <net/compat.h>
96#include <net/wext.h>
97#include <net/cls_cgroup.h>
97
98#include <net/sock.h>
99#include <linux/netfilter.h>
100
101#include <linux/if_tun.h>
102#include <linux/ipv6_route.h>
103#include <linux/route.h>
104#include <linux/sockios.h>

--- 448 unchanged lines hidden (view full) ---

553EXPORT_SYMBOL(sock_tx_timestamp);
554
555static inline int __sock_sendmsg(struct kiocb *iocb, struct socket *sock,
556 struct msghdr *msg, size_t size)
557{
558 struct sock_iocb *si = kiocb_to_siocb(iocb);
559 int err;
560
98
99#include <net/sock.h>
100#include <linux/netfilter.h>
101
102#include <linux/if_tun.h>
103#include <linux/ipv6_route.h>
104#include <linux/route.h>
105#include <linux/sockios.h>

--- 448 unchanged lines hidden (view full) ---

554EXPORT_SYMBOL(sock_tx_timestamp);
555
556static inline int __sock_sendmsg(struct kiocb *iocb, struct socket *sock,
557 struct msghdr *msg, size_t size)
558{
559 struct sock_iocb *si = kiocb_to_siocb(iocb);
560 int err;
561
562 sock_update_classid(sock->sk);
563
561 si->sock = sock;
562 si->scm = NULL;
563 si->msg = msg;
564 si->size = size;
565
566 err = security_socket_sendmsg(sock, msg, size);
567 if (err)
568 return err;

--- 110 unchanged lines hidden (view full) ---

679}
680EXPORT_SYMBOL_GPL(__sock_recv_ts_and_drops);
681
682static inline int __sock_recvmsg_nosec(struct kiocb *iocb, struct socket *sock,
683 struct msghdr *msg, size_t size, int flags)
684{
685 struct sock_iocb *si = kiocb_to_siocb(iocb);
686
564 si->sock = sock;
565 si->scm = NULL;
566 si->msg = msg;
567 si->size = size;
568
569 err = security_socket_sendmsg(sock, msg, size);
570 if (err)
571 return err;

--- 110 unchanged lines hidden (view full) ---

682}
683EXPORT_SYMBOL_GPL(__sock_recv_ts_and_drops);
684
685static inline int __sock_recvmsg_nosec(struct kiocb *iocb, struct socket *sock,
686 struct msghdr *msg, size_t size, int flags)
687{
688 struct sock_iocb *si = kiocb_to_siocb(iocb);
689
690 sock_update_classid(sock->sk);
691
687 si->sock = sock;
688 si->scm = NULL;
689 si->msg = msg;
690 si->size = size;
691 si->flags = flags;
692
693 return sock->ops->recvmsg(iocb, sock, msg, size, flags);
694}

--- 77 unchanged lines hidden (view full) ---

772 struct pipe_inode_info *pipe, size_t len,
773 unsigned int flags)
774{
775 struct socket *sock = file->private_data;
776
777 if (unlikely(!sock->ops->splice_read))
778 return -EINVAL;
779
692 si->sock = sock;
693 si->scm = NULL;
694 si->msg = msg;
695 si->size = size;
696 si->flags = flags;
697
698 return sock->ops->recvmsg(iocb, sock, msg, size, flags);
699}

--- 77 unchanged lines hidden (view full) ---

777 struct pipe_inode_info *pipe, size_t len,
778 unsigned int flags)
779{
780 struct socket *sock = file->private_data;
781
782 if (unlikely(!sock->ops->splice_read))
783 return -EINVAL;
784
785 sock_update_classid(sock->sk);
786
780 return sock->ops->splice_read(sock, ppos, pipe, len, flags);
781}
782
783static struct sock_iocb *alloc_sock_iocb(struct kiocb *iocb,
784 struct sock_iocb *siocb)
785{
786 if (!is_sync_kiocb(iocb)) {
787 siocb = kmalloc(sizeof(*siocb), GFP_KERNEL);

--- 2276 unchanged lines hidden (view full) ---

3064 optlen);
3065 set_fs(oldfs);
3066 return err;
3067}
3068
3069int kernel_sendpage(struct socket *sock, struct page *page, int offset,
3070 size_t size, int flags)
3071{
787 return sock->ops->splice_read(sock, ppos, pipe, len, flags);
788}
789
790static struct sock_iocb *alloc_sock_iocb(struct kiocb *iocb,
791 struct sock_iocb *siocb)
792{
793 if (!is_sync_kiocb(iocb)) {
794 siocb = kmalloc(sizeof(*siocb), GFP_KERNEL);

--- 2276 unchanged lines hidden (view full) ---

3071 optlen);
3072 set_fs(oldfs);
3073 return err;
3074}
3075
3076int kernel_sendpage(struct socket *sock, struct page *page, int offset,
3077 size_t size, int flags)
3078{
3079 sock_update_classid(sock->sk);
3080
3072 if (sock->ops->sendpage)
3073 return sock->ops->sendpage(sock, page, offset, size, flags);
3074
3075 return sock_no_sendpage(sock, page, offset, size, flags);
3076}
3077
3078int kernel_sock_ioctl(struct socket *sock, int cmd, unsigned long arg)
3079{

--- 39 unchanged lines hidden ---
3081 if (sock->ops->sendpage)
3082 return sock->ops->sendpage(sock, page, offset, size, flags);
3083
3084 return sock_no_sendpage(sock, page, offset, size, flags);
3085}
3086
3087int kernel_sock_ioctl(struct socket *sock, int cmd, unsigned long arg)
3088{

--- 39 unchanged lines hidden ---