diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-23 14:47:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-23 14:47:02 -0400 |
commit | 5f05647dd81c11a6a165ccc8f0c1370b16f3bcb0 (patch) | |
tree | 7851ef1c93aa1aba7ef327ca4b75fd35e6d10f29 /net/socket.c | |
parent | 02f36038c568111ad4fc433f6fa760ff5e38fab4 (diff) | |
parent | ec37a48d1d16c30b655ac5280209edf52a6775d4 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1699 commits)
bnx2/bnx2x: Unsupported Ethtool operations should return -EINVAL.
vlan: Calling vlan_hwaccel_do_receive() is always valid.
tproxy: use the interface primary IP address as a default value for --on-ip
tproxy: added IPv6 support to the socket match
cxgb3: function namespace cleanup
tproxy: added IPv6 support to the TPROXY target
tproxy: added IPv6 socket lookup function to nf_tproxy_core
be2net: Changes to use only priority codes allowed by f/w
tproxy: allow non-local binds of IPv6 sockets if IP_TRANSPARENT is enabled
tproxy: added tproxy sockopt interface in the IPV6 layer
tproxy: added udp6_lib_lookup function
tproxy: added const specifiers to udp lookup functions
tproxy: split off ipv6 defragmentation to a separate module
l2tp: small cleanup
nf_nat: restrict ICMP translation for embedded header
can: mcp251x: fix generation of error frames
can: mcp251x: fix endless loop in interrupt handler if CANINTF_MERRF is set
can-raw: add msg_flags to distinguish local traffic
9p: client code cleanup
rds: make local functions/variables static
...
Fix up conflicts in net/core/dev.c, drivers/net/pcmcia/smc91c92_cs.c and
drivers/net/wireless/ath/ath9k/debug.c as per David
Diffstat (limited to 'net/socket.c')
-rw-r--r-- | net/socket.c | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/net/socket.c b/net/socket.c index 9eac5c394134..abf3e2561521 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -209,8 +209,8 @@ int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr *kaddr) | |||
209 | * specified. Zero is returned for a success. | 209 | * specified. Zero is returned for a success. |
210 | */ | 210 | */ |
211 | 211 | ||
212 | int move_addr_to_user(struct sockaddr *kaddr, int klen, void __user *uaddr, | 212 | static int move_addr_to_user(struct sockaddr *kaddr, int klen, |
213 | int __user *ulen) | 213 | void __user *uaddr, int __user *ulen) |
214 | { | 214 | { |
215 | int err; | 215 | int err; |
216 | int len; | 216 | int len; |
@@ -536,14 +536,13 @@ void sock_release(struct socket *sock) | |||
536 | } | 536 | } |
537 | EXPORT_SYMBOL(sock_release); | 537 | EXPORT_SYMBOL(sock_release); |
538 | 538 | ||
539 | int sock_tx_timestamp(struct msghdr *msg, struct sock *sk, | 539 | int sock_tx_timestamp(struct sock *sk, __u8 *tx_flags) |
540 | union skb_shared_tx *shtx) | ||
541 | { | 540 | { |
542 | shtx->flags = 0; | 541 | *tx_flags = 0; |
543 | if (sock_flag(sk, SOCK_TIMESTAMPING_TX_HARDWARE)) | 542 | if (sock_flag(sk, SOCK_TIMESTAMPING_TX_HARDWARE)) |
544 | shtx->hardware = 1; | 543 | *tx_flags |= SKBTX_HW_TSTAMP; |
545 | if (sock_flag(sk, SOCK_TIMESTAMPING_TX_SOFTWARE)) | 544 | if (sock_flag(sk, SOCK_TIMESTAMPING_TX_SOFTWARE)) |
546 | shtx->software = 1; | 545 | *tx_flags |= SKBTX_SW_TSTAMP; |
547 | return 0; | 546 | return 0; |
548 | } | 547 | } |
549 | EXPORT_SYMBOL(sock_tx_timestamp); | 548 | EXPORT_SYMBOL(sock_tx_timestamp); |
@@ -663,7 +662,8 @@ void __sock_recv_timestamp(struct msghdr *msg, struct sock *sk, | |||
663 | } | 662 | } |
664 | EXPORT_SYMBOL_GPL(__sock_recv_timestamp); | 663 | EXPORT_SYMBOL_GPL(__sock_recv_timestamp); |
665 | 664 | ||
666 | inline void sock_recv_drops(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) | 665 | static inline void sock_recv_drops(struct msghdr *msg, struct sock *sk, |
666 | struct sk_buff *skb) | ||
667 | { | 667 | { |
668 | if (sock_flag(sk, SOCK_RXQ_OVFL) && skb && skb->dropcount) | 668 | if (sock_flag(sk, SOCK_RXQ_OVFL) && skb && skb->dropcount) |
669 | put_cmsg(msg, SOL_SOCKET, SO_RXQ_OVFL, | 669 | put_cmsg(msg, SOL_SOCKET, SO_RXQ_OVFL, |
@@ -1920,7 +1920,8 @@ SYSCALL_DEFINE3(sendmsg, int, fd, struct msghdr __user *, msg, unsigned, flags) | |||
1920 | * Afterwards, it will be a kernel pointer. Thus the compiler-assisted | 1920 | * Afterwards, it will be a kernel pointer. Thus the compiler-assisted |
1921 | * checking falls down on this. | 1921 | * checking falls down on this. |
1922 | */ | 1922 | */ |
1923 | if (copy_from_user(ctl_buf, (void __user *)msg_sys.msg_control, | 1923 | if (copy_from_user(ctl_buf, |
1924 | (void __user __force *)msg_sys.msg_control, | ||
1924 | ctl_len)) | 1925 | ctl_len)) |
1925 | goto out_freectl; | 1926 | goto out_freectl; |
1926 | msg_sys.msg_control = ctl_buf; | 1927 | msg_sys.msg_control = ctl_buf; |
@@ -3055,14 +3056,19 @@ int kernel_getsockopt(struct socket *sock, int level, int optname, | |||
3055 | char *optval, int *optlen) | 3056 | char *optval, int *optlen) |
3056 | { | 3057 | { |
3057 | mm_segment_t oldfs = get_fs(); | 3058 | mm_segment_t oldfs = get_fs(); |
3059 | char __user *uoptval; | ||
3060 | int __user *uoptlen; | ||
3058 | int err; | 3061 | int err; |
3059 | 3062 | ||
3063 | uoptval = (char __user __force *) optval; | ||
3064 | uoptlen = (int __user __force *) optlen; | ||
3065 | |||
3060 | set_fs(KERNEL_DS); | 3066 | set_fs(KERNEL_DS); |
3061 | if (level == SOL_SOCKET) | 3067 | if (level == SOL_SOCKET) |
3062 | err = sock_getsockopt(sock, level, optname, optval, optlen); | 3068 | err = sock_getsockopt(sock, level, optname, uoptval, uoptlen); |
3063 | else | 3069 | else |
3064 | err = sock->ops->getsockopt(sock, level, optname, optval, | 3070 | err = sock->ops->getsockopt(sock, level, optname, uoptval, |
3065 | optlen); | 3071 | uoptlen); |
3066 | set_fs(oldfs); | 3072 | set_fs(oldfs); |
3067 | return err; | 3073 | return err; |
3068 | } | 3074 | } |
@@ -3072,13 +3078,16 @@ int kernel_setsockopt(struct socket *sock, int level, int optname, | |||
3072 | char *optval, unsigned int optlen) | 3078 | char *optval, unsigned int optlen) |
3073 | { | 3079 | { |
3074 | mm_segment_t oldfs = get_fs(); | 3080 | mm_segment_t oldfs = get_fs(); |
3081 | char __user *uoptval; | ||
3075 | int err; | 3082 | int err; |
3076 | 3083 | ||
3084 | uoptval = (char __user __force *) optval; | ||
3085 | |||
3077 | set_fs(KERNEL_DS); | 3086 | set_fs(KERNEL_DS); |
3078 | if (level == SOL_SOCKET) | 3087 | if (level == SOL_SOCKET) |
3079 | err = sock_setsockopt(sock, level, optname, optval, optlen); | 3088 | err = sock_setsockopt(sock, level, optname, uoptval, optlen); |
3080 | else | 3089 | else |
3081 | err = sock->ops->setsockopt(sock, level, optname, optval, | 3090 | err = sock->ops->setsockopt(sock, level, optname, uoptval, |
3082 | optlen); | 3091 | optlen); |
3083 | set_fs(oldfs); | 3092 | set_fs(oldfs); |
3084 | return err; | 3093 | return err; |