ARM64: dts: rk3368-android: enable vpu_combo default
[firefly-linux-kernel-4.4.55.git] / net / netfilter / xt_qtaguid.c
index e1442bfb668dbaf9ecd3f7f425cc70a49b500a1a..3bf0c59dab2f54c50065b47632cbbbe31b1ff043 100644 (file)
@@ -1606,7 +1606,7 @@ static struct sock *qtaguid_find_sk(const struct sk_buff *skb,
                 * When in TCP_TIME_WAIT the sk is not a "struct sock" but
                 * "struct inet_timewait_sock" which is missing fields.
                 */
-               if (sk->sk_state  == TCP_TIME_WAIT) {
+               if (!sk_fullsock(sk) || sk->sk_state  == TCP_TIME_WAIT) {
                        sock_gen_put(sk);
                        sk = NULL;
                }
@@ -1689,7 +1689,7 @@ static bool qtaguid_mt(const struct sk_buff *skb, struct xt_action_param *par)
        /* default: Fall through and do UID releated work */
        }
 
-       sk = skb->sk;
+       sk = skb_to_full_sk(skb);
        /*
         * When in TCP_TIME_WAIT the sk is not a "struct sock" but
         * "struct inet_timewait_sock" which is missing fields.
@@ -1946,7 +1946,7 @@ static int qtaguid_ctrl_proc_show(struct seq_file *m, void *v)
                        );
                f_count = atomic_long_read(
                        &sock_tag_entry->socket->file->f_count);
-               seq_printf(m, "sock=%p tag=0x%llx (uid=%u) pid=%u "
+               seq_printf(m, "sock=%pK tag=0x%llx (uid=%u) pid=%u "
                           "f_count=%lu\n",
                           sock_tag_entry->sk,
                           sock_tag_entry->tag, uid,
@@ -2548,8 +2548,7 @@ static int pp_stats_line(struct seq_file *m, struct tag_stat *ts_entry,
        uid_t stat_uid = get_uid_from_tag(tag);
        struct proc_print_info *ppi = m->private;
        /* Detailed tags are not available to everybody */
-       if (get_atag_from_tag(tag) && !can_read_other_uid_stats(
-                                               make_kuid(&init_user_ns,stat_uid))) {
+       if (!can_read_other_uid_stats(make_kuid(&init_user_ns,stat_uid))) {
                CT_DEBUG("qtaguid: stats line: "
                         "%s 0x%llx %u: insufficient priv "
                         "from pid=%u tgid=%u uid=%u stats.gid=%u\n",