From 8a8ad1cf6587b127429ed180788cfe5137a53a23 Mon Sep 17 00:00:00 2001 From: John Stultz Date: Fri, 28 Mar 2014 12:19:27 -0700 Subject: [PATCH] net: kuid/kguid build fixes Small build fixes for xt_quota2 and ipv4 changes Change-Id: Ib098768040c8875887b2081c3165a6c83b37e180 Signed-off-by: John Stultz --- net/ipv4/tcp.c | 18 ++++++++++-------- net/netfilter/xt_quota2.c | 7 ++----- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index cab28756a96b..ced1683b2f3b 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -1289,7 +1289,8 @@ out_nopush: release_sock(sk); if (copied + copied_syn) - uid_stat_tcp_snd(current_uid(), copied + copied_syn); + uid_stat_tcp_snd(from_kuid(&init_user_ns, current_uid()), + copied + copied_syn); return copied + copied_syn; do_fault: @@ -1564,7 +1565,8 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc, if (copied > 0) { tcp_recv_skb(sk, seq, &offset); tcp_cleanup_rbuf(sk, copied); - uid_stat_tcp_rcv(current_uid(), copied); + uid_stat_tcp_rcv(from_kuid(&init_user_ns, current_uid()), + copied); } return copied; } @@ -1900,7 +1902,8 @@ skip_copy: release_sock(sk); if (copied > 0) - uid_stat_tcp_rcv(current_uid(), copied); + uid_stat_tcp_rcv(from_kuid(&init_user_ns, current_uid()), + copied); return copied; out: @@ -1910,7 +1913,8 @@ out: recv_urg: err = tcp_recv_urg(sk, msg, len, flags); if (err > 0) - uid_stat_tcp_rcv(current_uid(), err); + uid_stat_tcp_rcv(from_kuid(&init_user_ns, current_uid()), + err); goto out; recv_sndq: @@ -3229,7 +3233,7 @@ int tcp_nuke_addr(struct net *net, struct sockaddr *addr) struct in_addr *in; #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) - struct in6_addr *in6; + struct in6_addr *in6 = NULL; #endif if (family == AF_INET) { in = &((struct sockaddr_in *)addr)->sin_addr; @@ -3281,10 +3285,8 @@ restart: #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) if (family == AF_INET6) { struct in6_addr *s6; - if (!inet->pinet6) - continue; - s6 = &inet->pinet6->rcv_saddr; + s6 = &sk->sk_v6_rcv_saddr; if (ipv6_addr_type(s6) == IPV6_ADDR_MAPPED) continue; diff --git a/net/netfilter/xt_quota2.c b/net/netfilter/xt_quota2.c index 4328562572f6..99592ae56d9b 100644 --- a/net/netfilter/xt_quota2.c +++ b/net/netfilter/xt_quota2.c @@ -52,12 +52,9 @@ static DEFINE_SPINLOCK(counter_list_lock); static struct proc_dir_entry *proc_xt_quota; static unsigned int quota_list_perms = S_IRUGO | S_IWUSR; -static unsigned int quota_list_uid = 0; -static unsigned int quota_list_gid = 0; +static kuid_t quota_list_uid = KUIDT_INIT(0); +static kgid_t quota_list_gid = KGIDT_INIT(0); module_param_named(perms, quota_list_perms, uint, S_IRUGO | S_IWUSR); -module_param_named(uid, quota_list_uid, uint, S_IRUGO | S_IWUSR); -module_param_named(gid, quota_list_gid, uint, S_IRUGO | S_IWUSR); - #ifdef CONFIG_NETFILTER_XT_MATCH_QUOTA2_LOG static void quota2_log(unsigned int hooknum, -- 2.34.1