From: Amit Pundir Date: Mon, 11 May 2015 09:09:59 +0000 (+0530) Subject: nf: IDLETIMER: Fix broken uid field in the msg X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3a6018a2c8b4f0ca5b162c758dc73f3cbc9f5f98;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git nf: IDLETIMER: Fix broken uid field in the msg Create uid from kuid to fix the broken uid field in the message notifications introduced in Change-Id: I18fc73eada512e370d7ab24fc9f890845037b729, Otherwise we run into following build error: --------------- CC net/netfilter/xt_IDLETIMER.o net/netfilter/xt_IDLETIMER.c: In function ‘reset_timer’: net/netfilter/xt_IDLETIMER.c:360:16: error: incompatible types when assigning to type ‘uid_t’ from type ‘kuid_t’ make[2]: *** [net/netfilter/xt_IDLETIMER.o] Error 1 --------------- Signed-off-by: Amit Pundir (cherry picked from commit 706060ba3e1dee9ec3c4a4a1480d663b6cd71cad) Change-Id: Ifd66df45a58d1a5a60c3816c373ee3008292eee8 --- diff --git a/net/netfilter/xt_IDLETIMER.c b/net/netfilter/xt_IDLETIMER.c index a618b89f0c2b..0975c993a94e 100644 --- a/net/netfilter/xt_IDLETIMER.c +++ b/net/netfilter/xt_IDLETIMER.c @@ -354,12 +354,8 @@ static void reset_timer(const struct idletimer_tg_info *info, /* Stores the uid resposible for waking up the radio */ if (skb && (skb->sk)) { - struct sock *sk = skb->sk; - read_lock_bh(&sk->sk_callback_lock); - if ((sk->sk_socket) && (sk->sk_socket->file) && - (sk->sk_socket->file->f_cred)) - timer->uid = sk->sk_socket->file->f_cred->uid; - read_unlock_bh(&sk->sk_callback_lock); + timer->uid = from_kuid_munged(current_user_ns(), + sock_i_uid(skb->sk)); } /* checks if there is a pending inactive notification*/