diff options
| author | Yingjoe Chen <yingjoe.chen@mediatek.com> | 2015-10-16 13:29:27 +0800 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2016-12-19 10:30:09 +0100 |
| commit | 872455bc759cfe9c4f67293c1ee0d3dc7321e25b (patch) | |
| tree | ef292f1e46286f3f5f2e301bd7e18eb54c60c673 /net | |
| parent | 480c09f61c489e65f366e3a5a637fa4f1baa9746 (diff) | |
| download | android_kernel_m2note-872455bc759cfe9c4f67293c1ee0d3dc7321e25b.tar.gz | |
revert "Network: reset onnection by UID"
This reverts commit 3860aeacee01 ("Network:Reset Connection by UID")
Change-Id: I842aec64f563ba9d0b2b6f460b6d683bde30361e
CR-Id: ALPS02210363
Signed-off-by: Yingjoe Chen <yingjoe.chen@mediatek.com>
Diffstat (limited to 'net')
| -rw-r--r-- | net/ipv4/tcp.c | 20 | ||||
| -rw-r--r-- | net/ipv4/tcp_ipv4.c | 109 |
2 files changed, 0 insertions, 129 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index a0b04a1f2..5f0ac2122 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -580,26 +580,6 @@ int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg) else answ = tp->write_seq - tp->snd_nxt; break; - /* MTK_NET_CHANGES */ - case SIOCKILLSOCK: - { - struct uid_err uid_e; - if (copy_from_user(&uid_e, (char __user *)arg, sizeof(uid_e))) - return -EFAULT; - printk(KERN_WARNING "SIOCKILLSOCK uid = %d , err = %d", - uid_e.appuid, uid_e.errNum); - if (uid_e.errNum == 0) - { - // handle BR release problem - tcp_v4_handle_retrans_time_by_uid(uid_e); - } - else - { - tcp_v4_reset_connections_by_uid(uid_e); - } - - return 0; - } default: return -ENOIOCTLCMD; } diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 1bbdff22f..8eb98f447 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -2223,115 +2223,6 @@ void tcp_v4_destroy_sock(struct sock *sk) } EXPORT_SYMBOL(tcp_v4_destroy_sock); -void tcp_v4_handle_retrans_time_by_uid(struct uid_err uid_e) -{ - unsigned int bucket; - uid_t skuid = (uid_t)(uid_e.appuid); - struct inet_connection_sock *icsk = NULL;//inet_csk(sk); - - - for (bucket = 0; bucket < tcp_hashinfo.ehash_mask; bucket++) { - struct hlist_nulls_node *node; - struct sock *sk; - spinlock_t *lock = inet_ehash_lockp(&tcp_hashinfo, bucket); - - spin_lock_bh(lock); - sk_nulls_for_each(sk, node, &tcp_hashinfo.ehash[bucket].chain) { - - if (sysctl_ip_dynaddr && sk->sk_state == TCP_SYN_SENT) - continue; - if (sock_flag(sk, SOCK_DEAD)) - continue; - - if(sk->sk_socket){ - if(SOCK_INODE(sk->sk_socket)->i_uid != skuid) - continue; - else - printk("[mmspb] tcp_v4_handle_retrans_time_by_uid socket uid(%d) match!", - SOCK_INODE(sk->sk_socket)->i_uid); - } else{ - continue; - } - - sock_hold(sk); - spin_unlock_bh(lock); - - local_bh_disable(); - bh_lock_sock(sk); - - // update sk time out value - icsk = inet_csk(sk); - printk("[mmspb] tcp_v4_handle_retrans_time_by_uid update timer\n"); - - sk_reset_timer(sk, &icsk->icsk_retransmit_timer, jiffies + 2); - icsk->icsk_rto = sysctl_tcp_rto_min * 30; - icsk->icsk_MMSRB = 1; - - bh_unlock_sock(sk); - local_bh_enable(); - spin_lock_bh(lock); - sock_put(sk); - - } - spin_unlock_bh(lock); - } - -} - - -/* - * tcp_v4_nuke_addr_by_uid - destroy all sockets of spcial uid - */ -void tcp_v4_reset_connections_by_uid(struct uid_err uid_e) -{ - unsigned int bucket; - uid_t skuid = (uid_t)(uid_e.appuid); - - for (bucket = 0; bucket < tcp_hashinfo.ehash_mask; bucket++) { - struct hlist_nulls_node *node; - struct sock *sk; - spinlock_t *lock = inet_ehash_lockp(&tcp_hashinfo, bucket); - -restart: - spin_lock_bh(lock); - sk_nulls_for_each(sk, node, &tcp_hashinfo.ehash[bucket].chain) { - - if (sysctl_ip_dynaddr && sk->sk_state == TCP_SYN_SENT) - continue; - if (sock_flag(sk, SOCK_DEAD)) - continue; - - if(sk->sk_socket){ - if(SOCK_INODE(sk->sk_socket)->i_uid != skuid) - continue; - else - printk(KERN_INFO "SIOCKILLSOCK socket uid(%d) match!", - SOCK_INODE(sk->sk_socket)->i_uid); - } else{ - continue; - } - - sock_hold(sk); - spin_unlock_bh(lock); - - local_bh_disable(); - bh_lock_sock(sk); - sk->sk_err = uid_e.errNum; - printk(KERN_INFO "SIOCKILLSOCK set sk err == %d!! \n", sk->sk_err); - sk->sk_error_report(sk); - - tcp_done(sk); - bh_unlock_sock(sk); - local_bh_enable(); - sock_put(sk); - - goto restart; - } - spin_unlock_bh(lock); - } -} - - #ifdef CONFIG_PROC_FS /* Proc filesystem TCP sock list dumping. */ |
