ANDROID: xt_qtaguid: fix broken uid/gid range check
The existing test to check if current uid/gid is within valid range is broken due to missing parenthesis. Change-Id: I889ebbd0e2ea6a9426cb1509a2975e7107666407 Signed-off-by: Amit Pundir <amit.pundir@linaro.org> Signed-off-by: John Stultz <john.stultz@linaro.org>
This commit is contained in:
committed by
Dmitry Shmidt
parent
bd1bca4efb
commit
070eff8f02
@ -1773,8 +1773,8 @@ static bool qtaguid_mt(const struct sk_buff *skb, struct xt_action_param *par)
|
||||
kuid_t uid_min = make_kuid(&init_user_ns, info->uid_min);
|
||||
kuid_t uid_max = make_kuid(&init_user_ns, info->uid_max);
|
||||
|
||||
if (uid_gte(filp->f_cred->fsuid, uid_min) &&
|
||||
uid_lte(filp->f_cred->fsuid, uid_max) ^
|
||||
if ((uid_gte(filp->f_cred->fsuid, uid_min) &&
|
||||
uid_lte(filp->f_cred->fsuid, uid_max)) ^
|
||||
!(info->invert & XT_QTAGUID_UID)) {
|
||||
MT_DEBUG("qtaguid[%d]: leaving uid not matching\n",
|
||||
par->hooknum);
|
||||
@ -1786,8 +1786,8 @@ static bool qtaguid_mt(const struct sk_buff *skb, struct xt_action_param *par)
|
||||
kgid_t gid_min = make_kgid(&init_user_ns, info->gid_min);
|
||||
kgid_t gid_max = make_kgid(&init_user_ns, info->gid_max);
|
||||
|
||||
if (gid_gte(filp->f_cred->fsgid, gid_min) &&
|
||||
gid_lte(filp->f_cred->fsgid, gid_max) ^
|
||||
if ((gid_gte(filp->f_cred->fsgid, gid_min) &&
|
||||
gid_lte(filp->f_cred->fsgid, gid_max)) ^
|
||||
!(info->invert & XT_QTAGUID_GID)) {
|
||||
MT_DEBUG("qtaguid[%d]: leaving gid not matching\n",
|
||||
par->hooknum);
|
||||
|
||||
Reference in New Issue
Block a user